Well node is simple and way as well, but I am struggling with the relations which can contain many ways:
For example the relation https://www.openstreetmap.org/relation/2764083 contains two ways https://www.openstreetmap.org/way/26128247 and https://www.openstreetmap.org/way/205746186#map=18/48.21971/16.35130 which form the border.
However, how can I ensure that when I create a line string the whole (single) border is returned in a semantic correct way? A simple
GROUP BY then
collect_list for the ID of the relation on any of the nodes matching can only return the separate relations as
LINESTRINGs. How could these be merged in the right way or better a proper single geometry be returned in the first place?
I looked at the SQL from https://github.com/mojodna/osm2orc for inspiration but still struggle with the relations.