I'm currently using tilemaker https://github.com/systemed/tilemaker/blob/master/docs/CONFIGURATION.md to generate mbtiles from osm pbf files.
I'm setting, in the config file, the parameter include_ids
to true
to generate in each mbtiles object (node or way) the original osm ID.
"settings": {
"include_ids": true,
...
}
What I don't understand so far is that the ID which is generated by Tilemaker is actually not the original OSM ID, that I can fetch via obj:Id()
Is there any reason why tilemaker ID generated via the 'include_ids = true` is actually not the expected osm id from the initial source ?
I'm using queryRenderedFeatures
from maplibre
to verify the content of my mbtiles, and for instance I have
[
{
"type": "Feature",
"properties": {
"osm_id": "4349756002",
"name:latin": "Gilgamesch",
},
"id": 1103861383778,
"layer": {
"id": "poi",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "poi",
"metadata": {},
"minzoom": 15.5,
"layout": {
"text-font": [
where "osm_id": "4349756002"
is the real node id from OSM (that I'm manually getting from obj:Id()
from the pbf) and "id": 1103861383778
is the one generated by tilemaker
. I can confirm that the expected osm id is https://nominatim.openstreetmap.org/ui/details.html?osmtype=N&osmid=4349756002
Anyone able to shed a light on what I'm doing wrong? Curious if there is mask to apply to go from 1103861383778
to `4349756002``
Lowest 40 bits of feature.id is real OSM id, and the rest encodes type of object: 1=node, 2=way, 3=relation. See include/output_object.h in TileMaker source. So:
osmId = feature.id & 0xffffffffff;
osmType = feature.id >>> 40;