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

Disconnected line features #132

Open
ZeLonewolf opened this issue Nov 28, 2023 · 3 comments
Open

Disconnected line features #132

ZeLonewolf opened this issue Nov 28, 2023 · 3 comments

Comments

@ZeLonewolf
Copy link
Contributor

ZeLonewolf commented Nov 28, 2023

I'm seeing a few cases of line features that are disconnected:

In this location in OSM Americana we see the issue:

image

It's connected in the data:
image

... but is disconnected on my planetiler tileset:

image

@msbarry
Copy link
Collaborator

msbarry commented Dec 15, 2023

I think what happens here is that in the vector tile data these are 2 separate line features and the vertical one gets simplified which moves the connection point slightly. The default simplify tolerance at max zoom is 256/4096 or 0.0625 pixels or around 0.6 meters. That is as low as it can get with a max zoom of 14 and 4096 tile resolution

So you have a couple of options:

  • make sure your style makes roads wide enough that a 0.5m difference isn't noticeable (["interpolate", ["exponential", 2], ["zoom"], <initial zoom level>, <initial size in px>, 24, <width in meters> * 215 }] would make your road widths look like you are zooming in on a satellite map at high zooms
  • render to z15 to reduce the potential discrepancy to 0.25 meters (but double the tileset size)
  • increase the tile resolution from 4096 to say 8192 - but that would require a lot of changes in planetiler and increase your tile sizes
  • we could add a preprocessing step in planetiler that identifies nodes where transportation lines intersect, then split road segments at those intersections so the intersection points never get moved. That could get a bit complex and expensive though.

It's hard to do a "topology aware simplification" because each feature is initially simplified in isolation without knowledge of surrounding features.

@msbarry
Copy link
Collaborator

msbarry commented Feb 11, 2024

I realized we might be able avoid this by not simplifying z14 features at all (at least transportation and building layers), but that does increase max z14 tile sizes by 15-20%

@phanecak-maptiler
Copy link
Collaborator

The default simplify tolerance at max zoom is 256/4096 or 0.0625 pixels or around 0.6 meters.

plus:

I realized we might be able avoid this by not simplifying z14 features at all

I've tried --simplify-tolerance-at-max-zoom=0 and:

  1. It does fix the problem at overzoom
  2. But yes, it does increase the tilesize: I tried it on some smaller areas with tilesets from Z0 to Z1 and total increase is 1-2%

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

No branches or pull requests

3 participants