]> granicus.if.org Git - postgis/commitdiff
Update TopoJSON example with correct output, add note about arc indices
authorSandro Santilli <strk@keybit.net>
Wed, 20 Mar 2013 12:18:06 +0000 (12:18 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 20 Mar 2013 12:18:06 +0000 (12:18 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11188 b70326c6-7e19-0410-871a-916f4a2858ee

doc/extras_topology.xml

index 78ccb34581f57416524694093d6abfed64a5e864..ba1ef75bc2afb22c3d54ce5f7f136f6192a00591 100644 (file)
@@ -3147,6 +3147,13 @@ CREATE TABLE visited (
 The table, if given, is expected to have an "arc_id" field of type "serial" and an "edge_id" of type integer; the code will query the table for "edge_id" so it is recommended to add an index on that field.
 </para>
 
+               <note>
+<para>
+Arc indices in the TopoJSONjoutput are 0-based but they are 1-based
+in the "edgeMapTable" table.
+</para>
+    </note>
+
                <para>
 A full TopoJSON document will be need to contain, in addition to the snippets returned by this function, the actual arcs plus some headers. See the <ulink url="http://github.com/mbostock/topojson/wiki/Specification">TopoJSON specification</ulink>.
                </para>
@@ -3185,30 +3192,30 @@ SELECT ']}'::text as t
 
 -- Result:
 { "type": "Topology", "transform": { "scale": [1,1], "translate": [0,0] }, "objects": {
-"P1": { "type": "Polygon", "arcs": [[-1,-2,2,3,4,-6]]}
-"P2": { "type": "Polygon", "arcs": [[-7,-8,0,5,8,-10]]}
-"P3": { "type": "Polygon", "arcs": [[-11,-12,6,9,12,-14]]}
+"P1": { "type": "Polygon", "arcs": [[5,4,-4,-3,-2,0]]}
+"P2": { "type": "Polygon", "arcs": [[3,9,-9,-8,-7,2]]}
+"P3": { "type": "Polygon", "arcs": [[8,13,-13,-12,-11,7]]}
 "P4": { "type": "Polygon", "arcs": [[-15]]}
-"P5": { "type": "Polygon", "arcs": [[-16][16]]}
-"F3": { "type": "Polygon", "arcs": [[4,-6,-18,3]]}
-"F6": { "type": "Polygon", "arcs": [[17,-1,-2,2]]}
-"F3F4": { "type": "Polygon", "arcs": [[4,8,-10,18,-18,3]]}
-"F1": { "type": "Polygon", "arcs": [[-16][16]]}
+"P5": { "type": "Polygon", "arcs": [[-16],[16]]}
+"F3": { "type": "Polygon", "arcs": [[4,-4,-18,5]]}
+"F6": { "type": "Polygon", "arcs": [[17,-3,-2,0]]}
+"F3F4": { "type": "Polygon", "arcs": [[4,9,-9,18,-18,5]]}
+"F1": { "type": "Polygon", "arcs": [[-16],[16]]}
 }, "arcs": [
-[[21,6],[21,14]]
-[[9,6],[21,6]]
 [[9,6],[9,14]]
-[[9,14],[9,22]]
-[[9,22],[21,22]]
+[[9,6],[21,6]]
+[[21,6],[21,14]]
 [[21,14],[21,22]]
-[[35,6],[35,14]]
+[[9,22],[21,22]]
+[[9,14],[9,22]]
 [[21,6],[35,6]]
-[[21,22],[35,22]]
+[[35,6],[35,14]]
 [[35,14],[35,22]]
-[[47,6],[47,14]]
+[[21,22],[35,22]]
 [[35,6],[47,6]]
-[[35,22],[47,22]]
+[[47,6],[47,14]]
 [[47,14],[47,22]]
+[[35,22],[47,22]]
 [[25,30],[31,30],[31,40],[17,40],[17,30],[25,30]]
 [[8,30],[16,30],[16,38],[3,38],[3,30],[8,30]]
 [[4,31],[7,31],[7,34],[4,34],[4,31]]