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

Update topology bbox when applying toposimplify or topoquantize #130

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

mattijn
Copy link
Owner

@mattijn mattijn commented Sep 7, 2021

This PR fix #117. Once toposimplify is used the bbox of the overall topology should be updated as well. This is done through this PR. One thing to consider are data files that both contain points and lines. A topology does not apply on points, so for computing the bbox the location of the points should also be considered.

Example that the bbox is updated once applying topoquantize:

import topojson as tp

# load example data representing continental Africa
data = tp.utils.example_data_africa()  
# compute the topology
topo = tp.Topology(data)  
# apply simplification on the topology and render as SVG
bbox = topo.topoquantize(10).to_dict()['bbox'] 

assert bbox == (0, 0, 9, 9)

@mattijn mattijn merged commit cbbf1b9 into master Sep 7, 2021
@mattijn mattijn deleted the update-bbox-for-topoquantizesimplify 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.

Bbox is not re-computed after topoquantize and toposimplify
1 participant