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

Wrong encoded ids for some features #44

Open
zbycz opened this issue Nov 19, 2024 · 3 comments
Open

Wrong encoded ids for some features #44

zbycz opened this issue Nov 19, 2024 · 3 comments

Comments

@zbycz
Copy link

zbycz commented Nov 19, 2024

Hi,

we have integrated OpenFreeMap in osmapp.org, but there is an issue with type encoded in the id field in the MVT tiles. The last number in the id should encode 0=node, 1=way and 4=relation.

Example

  1. If I click on Prague while changed to OpenFreeMap layer – eg. here: osmapp.org#8.60/50.06/14.63
  2. I see in DevTools it has id 16018379311
  3. It is decoded as 1->way, thus way/1601837931, and osmapp brings us to this URL osmapp.org/way/1601837931
  4. same issue is with almost all active POIs on the map.

Expected result:
In reality it is a node, so it should end with 0. If we use the default layer Basic from Maptiler, it works correctly.

.

Relevant issues / related code:

Maptiler also had a long time issues with wrong encoding IDs, I believe they were using openmaptiles internally, but later switched to thier own impl (planetiler?) and that needed fixes to the id encoding too.

(same issue in indoor= stack: indoorequal/indoorequal#49)

@hyperknot
Copy link
Owner

Luckily it's a single change, OFM uses planetiler and planetiler uses this system

Yep that's the new behavior as of #826 - the vector tile feature IDs are osm ID * 10 + {1 for OSM nodes, 2 for OSM ways, 3 for OSM relations, 0 for any other source} so you can tell whether the feature came from a node, way or relation. You can set --feature-source-id-multiplier=false if you want to disable the behavior and just set vector tile feature IDs to the original ID of the osm element.

onthegomap/planetiler#1042 (comment)

Can you open an issue in planetiler to change the system to from 123 to 124?

@zbycz
Copy link
Author

zbycz commented Nov 29, 2024

Thanks @hyperknot! I added the issue here onthegomap/planetiler#1120 🤞

@hyperknot
Copy link
Owner

Great and really detailed issue! I'd mention that you are planning to use it for osmapp.org, which is a very impressive project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants