How can I use the overpass-API to recursively get all nodes and their coordinates which belong to the ways of an relation? I need this to draw bounding polygons of all the postal areas inside a city.
I have the following query:
<osm-script>
<area-query ref="3600062649" />
<recurse type="up" />
<query type="relation">
<item />
<has-kv k="boundary" v="postal_code" />
</query>
<print />
</osm-script>
This returns all relations with postal boundary inside the queried area and all the ways of these relations, however it does not return the nodes/coordinates of the points which make up these ways:
<relation id="1300371">
<member type="way" ref="51702433" role="outer"/>
...
<tag k="note" v="04451 Borsdorf"/>
...
</relation>
<relation>
....
</relation>
I would like to get a list of postal areas with their nodes, like this:
<relation id="1300371">
<member type="way" ref="51702433" role="outer">
<node id="323735839" lat="51.3751873" lon="12.5689796" />
....
</member>
<tag k="postal_code" v="04451"/>
...
</relation>
The tag with the postal code should still be included so I can distinguish all received postal areas.