[GIS] How to filter relation members in Overpass

overpass-api

My final goal is to get country borders from OSM via Overpass API.
I know my country's relation object id – http://www.openstreetmap.org/relation/59065 – and can get its details with the following query:

[out:json];
  rel(59065);
out body;

The relation members list contains ways (which comprise the country border) as well as some other nodes and relations.
How can I filter relation members to leave only way elements?

Best Answer

You cannot reduce the output of the relation itself (it will always include all elements). However, you can specify to only return ways, which are included in a relation:

[out:json];
rel(59065);
way(r);
out geom;

Try it in overpass turbo: http://overpass-turbo.eu/s/c0l and press "Run"

Related Question