-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Utilities to reduce tile size #669
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/onthegomap/planetiler/actions/runs/6289872727 ℹ️ Base Logs f556af2
ℹ️ This Branch Logs 36ba978
|
Kudos, SonarCloud Quality Gate passed! |
This was referenced Sep 24, 2023
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add some utilities to
FeatureMerge
that can be used to reduce tile size when called from a profile'spostProcess
method:mergeMultiPoint
to combine points with the same attributes into multipointsmergeMultiPolygon
to combine polygons with the same attributes into multipolygons (without merging overlapping ones)mergeMultiLineString
to merge lines with the same attributes into multilinestrings (without connecting endpoints)removePointsOutsideBuffer
to remove points more than a certain distance outside of a tile's border. Profiles may need to include points with a larger buffer for label grid / rank computation but then can use this as a final-pass filter.Also added a new command-line argument
--max-point-buffer
that lets the person running planetiler override the profile's max point buffer to a smaller value so that 1) profiles don't need to handle wiring through a new argument and copying the handling to each point layer and 2) so that a profile can set point buffers that are large enough to handle label collisions across tiles for renderers that render individual tiles without knowledge of their neighbors (ie. raster renderers) but then at generation-time you can limit the max point buffer if the one generating only needs to support clients that can handle label collisions across tiles (like maplibre-gl-js and native).We could eventually provide a
smoosh()
method or--smoosh
argument that applies all the tricks, but it seems better to start with lower level utilities you can opt into more granularity.Fixes openmaptiles/planetiler-openmaptiles#102