Replies: 4 comments 3 replies
-
This could either be a profile decision or default planetiler decision... Planetiler makes the feature ID inherit the osm element ID here to ensure the output remains the same for the same input: But profiles like protomaps basemap sets the ID explicitly to also encode whether its a node/way relation: So we could change the default planetiler behavior to be more like protomaps (although I'd probably only shift the ID left by 2 bits to save space on varint encoding) or change planetiler-openmaptiles to do something like what protomaps basemap does. WDYT? |
Beta Was this translation helpful? Give feedback.
-
OpenMapTiles is also doing some "hacks" on ID presumably to help distinguish whether the original OSM element is point or polygon:
But see then also openmaptiles/openmaptiles#1587 since it raises question how "serious" and "maintainable" such feature then could be. E.g. IMHO "yes, sure, can be done; but are we both able and willing to adhere to such API contract in the long term?" I do not oppose such change, but I do not like it very much. |
Beta Was this translation helpful? Give feedback.
-
I like this direction. As @phanecak-maptiler wrote, a similar approach is taken by some of the original OpenMapTiles layers. For example, in their poi layer, the OSM ids of nodes are multiplied by 10 osm_id * 10 AS osm_id_hash OSM ids of ways are multiplied by 10 and added 1, and OSM ids of relations (received as negative numbers from imposm) are multiplied by 1 and added 4 CASE
WHEN osm_id < 0 THEN -osm_id * 10 + 4
ELSE osm_id * 10 + 1
END AS osm_id_hash I think that the base-10 approach is a bit more human friendly, and the decomposition can be done easily using division and modulo 10. That's even possible using Maplibre style spec expressions:
|
Beta Was this translation helpful? Give feedback.
-
Sounds good to me, implemented the It looks like that increases tile size a bit (~1%) by making the varint encoding less effective. We can make the difference negligible if we did see #827 (comment) (*3) |
Beta Was this translation helpful? Give feedback.
-
I would like to be able to identify the OSM element of the features received by
queryRenderedFeatures
. I understand that the feature id captures the OSM id, for OSM-based features, but that id may belong to a node, a way, or a relation.For example, the origin of features of the "poi" layer in planetiler-openmaptiles could be nodes, ways, or relations.
Is there a way to know the OSM element type, or add it to the tile data?
Beta Was this translation helpful? Give feedback.
All reactions