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

Adjustment of buffer pixel overrides for better evaluation of MIN_LENGTH for transportation_name #28

Merged

Conversation

phanecak-maptiler
Copy link
Owner

@phanecak-maptiler phanecak-maptiler commented Nov 28, 2023

update: This PR increases buffer pixel overrides so as to allow proper evaluation of (unchanged) MIN_LENGTH for lines which cross tiles.

older description (= "how it started"), which no longer matches the PR (= "how it's going"):

This PR adjusts MIN_LENGTH for transportation_name to 1/2 of values used in OpenMapTiles, to partially counter the effect of Planetiler applying the limit before merging (while OpenMapTiles is applying the limit after merging).

What is produced by OpenMapTiles/master: Rhode Island, Z9

Screenshot-Rhode_Island-Z9-OMT-master

What is produced by phanecak-maptiler/planetiler-openmaptiles/omt_3_15_0:

Screenshot-Rhode_Island-Z9-PR-before

And what is produced with adjustments in this PR:

Screenshot from 2023-12-11 19-51-37-Z9

Example of filtering:

Note: Difference was observed while porting openmaptiles/openmaptiles#1579 , hence same area used in screenshots here.

@phanecak-maptiler phanecak-maptiler self-assigned this Nov 28, 2023
Comment on lines 115 to 120
.put(6, 10_000)
.put(7, 10_000)
.put(8, 7_000)
.put(9, 4_000)
.put(10, 2_000)
.put(11, 1_000);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic below actually does apply this min-length filter after the merge. It just needs to set setBufferPixelOverrides before the merge to ensure that when post-processing a tile we have visibility into enough of the line outside the tile bounds.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, the bug seems to be that MIN_LENGTH is used also for setBufferPixelOverrides().

With https://www.openstreetmap.org/way/220348633#map=13/41.5817/-71.3907 as an example, its end near airport is different tile at Z13 and given long name (compared to what is in MIN_LENGTH for Z13) the end gets cut. Hence I've added BUFFER_PIXEL_OVERRIDES with 256 px (e.g. "while tile"):

Screenshot-Rhode_Island-Z13

Is that OK? Is there a simpler way?

…lanetiler applying the limit before merging"

This reverts commit 8fb6707.
Make sure we have enough room (=whole next tile) when checking MIN_LENGTH,
to avoid pieces of otherwise "long enough" lines to be excluded (thus
creating "holes" or missing ends) in some tiles just because length in that
particular tile is bellow limit. Given that MIN_LENGTH values translated to
pixels are quite big (compared to {@code BUFFER_SIZE}), such missing pieces
would be quite noticeable.

This improves items mainly in Z12-Z13.
@phanecak-maptiler phanecak-maptiler merged commit c992cfb into omt_3_15_0 Dec 22, 2023
@phanecak-maptiler phanecak-maptiler changed the title Adjustment of MIN_LENGTH for transportation_name Adjustment of buffer pixel overrides for better evaluation of MIN_LENGTH for transportation_name Jan 8, 2024
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.

None yet

2 participants