3

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?

1 Answer 1

4

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"

1
  • 2
    What about only polygons of a relation?
    – Vanuan
    Feb 22, 2016 at 3:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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