Skip to content

How to select specific role members of relations and combine to create geometry #1752

Closed Answered by joto
mboeringa asked this question in Q&A
Discussion options

You must be logged in to vote

In https://osm2pgsql.org/doc/manual.html#processing-callbacks you can see that there is a members array you can access from the parameter of the processing callback which contains all the members with their roles. The GeometryCollection we spoke about contains one geometry for each node and way member, so you can iterate over both the object.members array as well as the result of object:as_geometrycollection() at the same time, ignore the members of type relation and you have a one-to-one correspondence between roles and geometry.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@mboeringa
Comment options

Answer selected by mboeringa
Comment options

You must be logged in to vote
2 replies
@joto
Comment options

joto Sep 7, 2022
Maintainer

@mboeringa
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants