From: Sandro Santilli Date: Wed, 20 Mar 2013 12:18:06 +0000 (+0000) Subject: Update TopoJSON example with correct output, add note about arc indices X-Git-Tag: 2.1.0beta2~160 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=764ef960c76dd34aa72d4d10fb2cd8db64aeec74;p=postgis Update TopoJSON example with correct output, add note about arc indices git-svn-id: http://svn.osgeo.org/postgis/trunk@11188 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/extras_topology.xml b/doc/extras_topology.xml index 78ccb3458..ba1ef75bc 100644 --- a/doc/extras_topology.xml +++ b/doc/extras_topology.xml @@ -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. + + +Arc indices in the TopoJSONjoutput are 0-based but they are 1-based +in the "edgeMapTable" table. + + + 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 TopoJSON specification. @@ -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]]