Blob Blame History Raw
.TH TOPO2GEO "1" "January 2021" "" "User Commands"
.SH NAME
topo2geo \- converts TopoJSON objects to GeoJSON features
.SH SYNOPSIS
.B topo2geo
.RI [ options ]
.RI <[ name =] file >\ ...
.SH DESCRIPTION
.P
Converts one or more TopoJSON objects from an input topology to one or more
GeoJSON features.
For example, to convert the \[lq]states\[rq] TopoJSON GeometryCollection object
in us.json to a GeoJSON feature collection in us-states.json:
.P
.in +4n
.EX
.B topo2geo states=us-states.json < us.json
.EE
.in
.P
For convenience, you can omit the object name and specify only the
.I file
name; the object name will be the basename of the file, with the directory and
extension removed.
For example, to convert the \[lq]states\[rq] TopoJSON GeometryCollection object
in us.json to a GeoJSON feature collection in states.json:
.P
.in +4n
.EX
.B topo2geo states.json < us.json
.EE
.in
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
Output usage information.
.TP
.BR \-V , \ \-\-version
Output the version number.
.TP
.BR \-n , \ \-\-newline\-delimited
Output
.UR https://ndjson.org/
newline-delimited JSON
.UE ,
with one feature per line.
.TP
.BR \-i , \ \-\-in\ \fIfile
Specify the input TopoJSON file name.
Defaults to
.B \-
for stdin.
.TP
.BR \-l , \ \-\-list
List the names of the objects in the input topology, and then exit.
For example, this:
.IP
.in +4n
.EX
.B topo2geo -l < us.json
.EE
.in
.IP
Will output this:
.IP
.in +4n
.EX
.B counties
.B states
.B nation
.EE
.in
.SH "SEE ALSO"
.BR geo2topo (1),
.BR topomerge (1),
.BR topoquantize (1),
.BR toposimplify (1)