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>
-- 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]]