geo2topo - Man Page

converts GeoJSON features to TopoJSON objects


geo2topo [options] [name=]file ...


Converts one or more GeoJSON objects to an output topology. For example, to convert a GeoJSON FeatureCollection in the input file us-states.json to a TopologyJSON topology in the output file us.json:

geo2topo states=us-states.json > us.json

The resulting topology has a “states” object which corresponds to the input geometry. For convenience, you can omit the object name and specify only the output file name; the object name will then be the basename of the file, with the directory and extension removed. For example, to convert the states.json GeoJSON FeatureCollection to a TopologyJSON topology with the “states” object in us.json:

geo2topo states.json > us.json

Any properties and identifiers of input feature objects are propagated to the output. If you want to transform or filter properties, try ndjson-cli as demonstrated in Command-Line Cartography (


-h,  --help

Output usage information.


Output the version number.


Accept newline-delimited JSON, with one feature per line.

-o--out file

Specify the output TopoJSON file name. Defaults to - for stdout.

-q--quantization count

Specify a pre-quantization parameter. 0 disables quantization.

If a quantization parameter is specified, the input geometry is quantized prior to computing the topology, the returned topology is quantized, and its arcs are delta-encoded. Quantization is recommended to improve the quality of the topology if the input geometry is messy (i.e., small floating point error means that adjacent boundaries do not have identical values); typical values are powers of ten, such as 1e4, 1e5 or 1e6. See also topoquantize(1) to quantize a topology after it has been constructed, without altering the topological relationships.

See Also

topo2geo(1), topomerge(1), topoquantize(1), toposimplify(1)

Referenced By

topo2geo(1), topomerge(1), topoquantize(1), toposimplify(1).

January 2021