Thank you for your detailed response. I now finally have the time to look at 
this again, and what you have written has been very helpful so far.

It seems like I will be able to find a way to achieve this by keeping things 
the way they are for multipolygon relations, but resolving the geometries of 
route relations in the second stage only, although this will be a bit of work 
to implement.

I am not deep enough in the internals of how osm2pgsql actually works to make a 
qualified suggestion how it could be improved to support my use case. From my 
novice point of view it seems like the `object:as_multilinestring()` relation 
method would be the usual approach to achieve what I am trying to do, and it 
does seem convenient. The specific functionality that I’m missing for my use 
case is to exclude relation members based on their _tags_. It seems to me like 
this is something that could be added somehow, since I supposed the method 
needs to load the individual member objects anyways to resolve their 
geometries, so it wouldn’t cause an additional performance regression? 
Interestingly, even if I ignore a way in the `osm2pgsql.process_way(object)` 
function both in the first and second stage, its geometry is still added to the 
relation. However, I suspect that I might be able to exclude members of the 
relation based on their _role_ by simply deleting them from the `members` 
property before calling `object:as_multilinestring()`. I will have to try this 
out, and if it works this could be a feasible solution that wouldn’t even 
require two-stage processing, as railway platforms can be identified both by 
their member role as well as by their object tags.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2204#discussioncomment-12146897
You are receiving this because you are subscribed to this thread.

Message ID: 
<osm2pgsql-dev/osm2pgsql/repo-discussions/2204/comments/[email protected]>
_______________________________________________
Tile-serving mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/tile-serving

Reply via email to