question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support i/o to topojson format

See original GitHub issue

Topojson is pretty handy for data visualisation when working with adjacent polygons (think- counties in the state/country). While there is a separate topojson package (https://github.com/calvinmetcalf/topojson.py), I am pretty sure geopandas will benefit from direct I/o functionality. I will be happy to PR, but will be thankful for the suggestions first.

  1. do you feel fine with adding topojson module as an optional dependency??
  2. what will be the best way to use topojson?

2.1

with open('file.json', 'w') as f:
    df.to_json(f, topo=True)

2.2

with open('file.json', 'w') as f:
    df.to_topojson(f)

as for reading, it seems reasonable to try parse topojson if geojson parsing fails?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
jorisvandenbosschecommented, Nov 12, 2017

Documentation about supported formats is indeed sparse. PR to improve that certainly welcome!

Normally I would say: the support depends on fiona, but even in the fiona.supported_drivers I don’t see topojson being mentioned (although that might be because until recently gdal support was under the geojson driver:http://www.gdal.org/drv_topojson.html).

If fiona supports reading, it might also support it for writing.

3reactions
Casyfillcommented, Nov 12, 2017

just realized topojson is supported for reading (read_file), while I found no documentation on that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

support TopoJSON as export format · Issue #199 · koopjs/koop
The TopoJSON output is now supported by koop-output-geojson. All reactions.
Read more >
Converting Shapefiles to TopoJSON - Looker Community
This article demonstrates how to convert a shapefile to TopoJSON using a free online tool called Mapshaper 5. For a drawing tool that...
Read more >
TopoJSON / Formats / Placemark
Have feedback or a question that isn't answered here? Contact us by email. ... The modern way to collaborate on, manage, and edit...
Read more >
ArcGIS GeoService API could deliver TopoJSON format
Specifically, I want to deliver confidential data with special handling requirements (e.g. HIPAA) from my ArcGIS Enterprise deployment directly ...
Read more >
geojsonio: Convert Data from and to 'GeoJSON' or 'TopoJSON'
input-output ... Convert spatial data files to GeoJSON from various formats. Description ... service, and "local" means we use sf.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found