Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to gdf use to geojson #108

Merged
merged 2 commits into from
Aug 21, 2020
Merged

Fix to gdf use to geojson #108

merged 2 commits into from
Aug 21, 2020

Conversation

mattijn
Copy link
Owner

@mattijn mattijn commented Aug 21, 2020

This PR changes the to_gdf() function. I'm stepping away from the build-in TopoJSON driver within OGR/Fiona, since it is not robust enough.

Fiona cannot handle nested GeometryCollections and, more important, ignores winding order.

The to_gdf() function now serializes the GeoDataFrame through internally serializing to GeoJSON first.

Moreover, the to_geojson() function was failing when polygons somehow ended-up with only 2 coordinates (eg due to oversimplification), This PR now extends the coordinates with its first coordinate when creating a GeoJSON format if this happens. Aligning itself hereby with the Javascript topojson-client codebase.

Fix #102

@mattijn mattijn merged commit d22b02b into master Aug 21, 2020
@mattijn mattijn deleted the fix-to_gdf-use-to_geojson branch August 21, 2020 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

winding_order does not work for enclosed polygons
1 participant