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

toposimplify wrongly applied on Topojson data from file #140

Closed
mattijn opened this issue Sep 12, 2021 · 0 comments · Fixed by #141
Closed

toposimplify wrongly applied on Topojson data from file #140

mattijn opened this issue Sep 12, 2021 · 0 comments · Fixed by #141

Comments

@mattijn
Copy link
Owner

mattijn commented Sep 12, 2021

Observe:

import json
import topojson

# load topojson file into dict
with open("/Users/mattijnvanhoek/Downloads/gm.topo.json", 'r') as f:
    data = json.load(f)
print(data['objects'].keys())

# read as topojson and as geojson
topo_0 = topojson.Topology(data, object_name="gm_features")
topo_1 = topojson.Topology(topo_0.to_geojson(), object_name="out")

topo_0.toposimplify(10).to_gdf().plot()
topo_1.toposimplify(10).to_gdf().plot()
dict_keys(['nl_features', 'gm_features'])

image

topo_0 is going wrong, where topo_1 is going right

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 a pull request may close this issue.

1 participant