1GEO2TOPO(1) User Commands GEO2TOPO(1)
2
3
4
6 geo2topo - converts GeoJSON features to TopoJSON objects
7
9 geo2topo [options] [name=]file ...
10
12 Converts one or more GeoJSON objects to an output topology. For exam‐
13 ple, to convert a GeoJSON FeatureCollection in the input file us-
14 states.json to a TopologyJSON topology in the output file us.json:
15
16 geo2topo states=us-states.json > us.json
17
18 The resulting topology has a “states” object which corresponds to the
19 input geometry. For convenience, you can omit the object name and
20 specify only the output file name; the object name will then be the
21 basename of the file, with the directory and extension removed. For
22 example, to convert the states.json GeoJSON FeatureCollection to a
23 TopologyJSON topology with the “states” object in us.json:
24
25 geo2topo states.json > us.json
26
27 Any properties and identifiers of input feature objects are propagated
28 to the output. If you want to transform or filter properties, try ndj‐
29 son-cli as demonstrated in Command-Line Cartography
30 (https://medium.com/@mbostock/command-line-cartography-
31 part-1-897aa8f8ca2c).
32
34 -h, --help
35 Output usage information.
36
37 -V, --version
38 Output the version number.
39
40 -n, --newline-delimited
41 Accept newline-delimited JSON ⟨https://ndjson.org/⟩, with one
42 feature per line.
43
44 -o, --out file
45 Specify the output TopoJSON file name. Defaults to - for std‐
46 out.
47
48 -q, --quantization count
49 Specify a pre-quantization parameter. 0 disables quantization.
50
51 If a quantization parameter is specified, the input geometry is
52 quantized prior to computing the topology, the returned topology
53 is quantized, and its arcs are delta-encoded. Quantization is
54 recommended to improve the quality of the topology if the input
55 geometry is messy (i.e., small floating point error means that
56 adjacent boundaries do not have identical values); typical val‐
57 ues are powers of ten, such as 1e4, 1e5 or 1e6. See also topo‐
58 quantize(1) to quantize a topology after it has been construc‐
59 ted, without altering the topological relationships.
60
62 topo2geo(1), topomerge(1), topoquantize(1), toposimplify(1)
63
64
65
66 January 2021 GEO2TOPO(1)