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

Keep OSM feature type in the final mbtiles file #740

Open
laem opened this issue Aug 6, 2024 · 7 comments
Open

Keep OSM feature type in the final mbtiles file #740

laem opened this issue Aug 6, 2024 · 7 comments

Comments

@laem
Copy link
Contributor

laem commented Aug 6, 2024

Hi, I found the include_ids option in the parameters, but I can't find an option to store the OSM feature type as well : node, way or relation.

It makes it very difficult to link the tiles' nodes to OSM on the final map.

I wonder if it's possible to add someting in the process-openmaptiles.lua file... Any help appreciated, thanks :)

@laem
Copy link
Contributor Author

laem commented Aug 6, 2024

Exemple inspecting the mbtiles produces with the default tilemaker options with include_ids.

Sélection_230

This "Point" is in fact a way https://www.openstreetmap.org/way/64518593#map=20/47.55544/-3.13397&layers=H

@systemed
Copy link
Owner

systemed commented Aug 6, 2024

The $id is a dedicated field in the vector tiles, rather than an user-set attribute: see 4.2 in https://github.com/mapbox/vector-tile-spec/tree/master/2.1. There is no dedicated field for an "id type".

If you do want to add it as an attribute, you could certainly do that in process.lua. In node_function you'd add a line like Attribute("obj_type", "node"), in way_function you'd add Attribute("obj_type","way") and so on.

@laem
Copy link
Contributor Author

laem commented Aug 6, 2024

Thanks for your quick answer !
I just tried this https://github.com/laem/gtfs/blob/master/tilemaker/resources/process-openmaptiles.lua#L124 without success yet, but I'm investigating.

@laem
Copy link
Contributor Author

laem commented Aug 6, 2024

Mmmh maybe WritePOI needs to be modified as well.

@laem
Copy link
Contributor Author

laem commented Aug 6, 2024

Awesome :)

image

@laem
Copy link
Contributor Author

laem commented Aug 6, 2024

Do you think I should open a PR to add this attribute to the default process-openmaptiles.lua ? Else, the PR can be closed. Thanks again !

@laem
Copy link
Contributor Author

laem commented Oct 24, 2024

Hi @systemed, what about relations that are handled by way_function, is it possible to know that a feature treated by way_function is an OSM relation ?

Tilemaker handles multipolygon relations natively. The combined geometries are processed as ways (i.e. by way_function), so if your function puts buildings in a 'buildings' layer, tilemaker will cope with this whether the building is mapped as a simple way or a multipolygon. The only difference is that they're given an artificial ID. Multipolygons are expected to have tags on the relation, not the outer way.

E.g. some schools can be ways or relations. This one is a relation, but in my tiles I want to keep track of the original OSM object, so I need to keep its original relation status.

I haven't been able to find a way to do that.

Could way_function get a parameter that tells the original status of the OSM feature ?

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

2 participants