Merges compatible Point features into MultiPoint #725
Merged
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.
For #719: This changeset merges multiple compatible points into a single multipoint.
Motivation: while looking into the MVT spec and how it's implemented in Everything You Wanted to Know About Vector Tiles (But Were Afraid to Ask) I learned about inefficiencies in encoding single points in tiles and how multipoints help there. Turns out tilemaker did not emit multipoints - let's change that!
This changeset combines multiple point features into a single multipoint so that the tiles will be smaller, there is less to encode/decode, and the frontend clients only have to decode a single multipoint feature with multiple
MoveTo
commands.How much this will help in practice depends on the configs and areas used and the points have to be compatible (attributes).
@systemed I would appreciate a review here since my C++ is a bit rusty nowadays! Also how do we best test this change? I ran it manually on a few pbf files but otherwise how do we make sure this is working as intended?
More context in
If you run with the
--verbose
flag you get to see the debug output