[Tile-serving] [openstreetmap/osm2pgsql] How to select specific role members of relations and combine to create geometry (Discussion #1752)
mboeringa
notifications at github.com
Sun Sep 4 18:56:11 UTC 2022
Hi @joto,
We had the opportunity to talk about some of the new functionality and developments regarding osm2pgsql at SOTM 2022 (really enjoyed the conference!), and my specific question whether it was now possible to select specific role members of a relation, and use only those for creating a geometry in **flex** output.
The specific use case being, as explained then and before, the ability to select only those members with the role 'main_stream' of a 'waterway' relation.
You suggested I should look at the new options to create a geometry collection, and then go over the members of the collection to sort things out in Lua.
However, reading quite extensively through the updated osm2pgsql manual, it is still unclear how this would help my use case, as the geometry collection only contains the actual geometries, but no information about e.g. the roles, and there appears no clear way to store or access this vital information.
You already suggested there was not yet a straightforward way to do this. What we actually appear to need is some kind of filter statement, most likely as an input parameter to the
`osm2pgsql.process_relation(object)`
function, so that it becomes possible to filter out certain roles, although this would also require the ability to specify relation type specific filter statements, e.g. as a Lua table, as a single filter statement should only be applied to a single specific relation type, as with the 'main_stream' role for the 'waterway' relation type.
Jochen, what are your thoughts on this? And if you still see an option to do this with the current v1.7.0 version of osm2pgsql, could you perhaps give some more clues as to how, or include a working example in the repository's 'flex-config' example styles folder?
Actually, interestingly, I noticed the old **pgsql** output option, actually appears to have a function that gives access to some of these properties of a relation, like the roles:
`filter_tags_relation_member(tags, member_tags, roles, num_members)`
Don't know how this fits in the bigger picture of the new **flex** output though, maybe you have something sensible to say about that, although it is clear from the documentation this function only concerns tags, not geometry processing.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/discussions/1752
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/osm2pgsql/repo-discussions/1752 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220904/fa791e36/attachment.htm>
More information about the Tile-serving
mailing list