Reconstruct a single way based on multiple ways that share a common tag #516
-
I'm trying to build a single way object and store it in a tile (to be able to query it later on).
The objective is to collect the hiking trail "Karamatura Track" in a single unique way, that could then :
Is there any way with tilemaker to answer such requirement, as in keeping a buffer of each ways encountered and then working with them in a second step ? As of now I'm using osmium with 2 handlers, one that records all ways of interest (in this case, highway=path, and name!=nil), and then a second handler that, based on each name collected, collects all others ways (such as steps, bridge, track, ...) and reconstruct each way - but it would be much more efficient if I could handle such kind of request directly when processing my .pbf and building all my other tiles Also if it makes "more sense" to understand what I'm trying to achieve, just see it as if i was trying to create "missing" OSM relation |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
You should be able to do that by writing an object to a layer with just that name attribute, no others, then using tilemaker’s combine_below setting which automatically merges linestrings with the same attributes within the same layer. |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks a lot, it looks like it might have worked. The layer looks good. It's hard to tell since as of now the only way I can query an object is with queryRenderedFeatures from mapLibre, which "splits" the rendered object in multiple ones. I've been struggling with that for a while and I understood that there wasn't any way to query the entire object with maplibre library (limited to the viewport - but it's another topic), and I've never been able to find other library to troubleshoot mbtiles. |
Beta Was this translation helpful? Give feedback.
-
thanks again |
Beta Was this translation helpful? Give feedback.
-
You're totally right - I've just skipped part of what I was intending to do, and for instance i'd like to add an ID to each of those combined ways - which, unless i'm wrong, will not be possible to do with this workaround, since the combination occurs in a higher layer of the process. I'm still convince that the ways I'm trying to reconstruct should be directly combined as relation in OSM, but since that's not the case I don't have any other choices. I was wondering if creating a layer with objects that already exist in other layers (for instance with your workaround, all the objects are already in my "highway" layer) could save some size compared to adding another specific mbtiles built with osmium ? If i build 2 layers based on the same objects, would that take twice the size or it's not that simple ? I've managed to run vt2geojson! thanks again for your precious help. |
Beta Was this translation helpful? Give feedback.
-
With the tilemaker solution you've provided above ( I'm looking for a way to generate object that have in common:
Or should I post-process the mbtiles first ? Also what I'm struggling with my current solution (using osmium) is that if 2 objects have the same name,but are not related (imagine 2 hikes having the same name but being in different region) they would end up being combined in the same object. |
Beta Was this translation helpful? Give feedback.
You should be able to do that by writing an object to a layer with just that name attribute, no others, then using tilemaker’s combine_below setting which automatically merges linestrings with the same attributes within the same layer.