1

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?

2

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"

  • What about only polygons of a relation? – Vanuan Feb 22 '16 at 3:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.