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 case surround repeating coords during quantization #116

Merged
merged 2 commits into from
Dec 12, 2020

Conversation

mattijn
Copy link
Owner

@mattijn mattijn commented Dec 12, 2020

This PR fix #110.

After quantization the repeating coordinates in a linestring are filtered. But it should not happen that LineStrings become Points due to removal of repeating coordinates. This was correctly computed, but this case was not written back to the corresponding LineString.

Now this resolves correctly

import topojson as tp
import geopandas as gpd

gdf = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
gdf = gdf[gdf.name.isin(['France', 'Belgium', 'Netherlands'])]
tp.Topology(data=gdf).toposimplify(4).topoquantize(500).to_alt(color='properties.name:N')

image

@mattijn mattijn merged commit d7b586d into master Dec 12, 2020
@mattijn mattijn deleted the fix-non-repeating-coords-during-quantization branch June 9, 2022 12: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.

Investigate the effects of low topoquantization epsilon values
1 participant