Skip to main content

CLI for converting TopoJSON files to GeoJSON

Project description

topo2geo

CLI for converting TopoJSON files to GeoJSON

Installation

pip install topo2geo

Depends on shapely and click

Usage

[~]$ topo2geo input.topojson output.geojson

Multilayered Topojsons

If the topojson contains mulitple layers (i.e. there are multiple values in the "objects" key). Then seperate geojson files will be output with the layer name.

For example a topojson containing states and counties:

{
    "type": "Topology",
    "objects": {
        "county": {
            "type": "GeometryCollection",
            "geometries": [...]
        },
        "state": {
            "type": "GeometryCollection",
            "geometries": [...]
        }
    }
}

would produce two geojson files, output_geo_county.json and output_geo_state.json

Troubleshooting

If you experience a "segmentation fault" one thing to try is explained here:

pip install shapely --no-binary shapely

Credits

Originally written by sgillies and perrygeo. Converted to Python3 and packaged into a CLI by kylepollina.

Sources:


License - https://github.com/topojson/topojson/blob/master/LICENSE.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

topo2geo-0.4.4-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file topo2geo-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: topo2geo-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for topo2geo-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 df1067bc7c76c498a29e458a3ca9bb521c78ea3383e4a594c7b4b97bc1f56153
MD5 541bb49635d3bb55f0a6136dac7fc92a
BLAKE2b-256 f8327f509e8a778c19c11d6f689e24ceb98679cf414035aa98840d50d8a45aed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page