This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Overpass: query only outer ways of multipolygon

0

Hi,

I'm trying to find out how to get all outer ways of a set of multipolygon relationships.

This is what my query looks like right now:

http://www.overpass-api.de/api/interpreter?data=[out:json];
relation["type"="multipolygon"](52.51,13.36,52.52,13.39);
way(r)["building"];
out qt;

It selects all building ways that are part of a multipolygon. How can I remove the ones the are set to role: "outer"?

EDIT

The last part should read: How can I remove the ones the are set to role: "inner"?

asked 26 Jul '14, 20:38

burgerer's gravatar image

burgerer
16112
accept rate: 0%

edited 27 Jul '14, 13:38


One Answer:

1

Your question is not entirely clear/ a bit of a contradiction. I guess what you're looking for is the first part of this answer. Just in case you want to remove some ways with a specific role from your result set, you can check out the second part of this answer.

In your question summary, you mentioned that only want to retrieve buildings with role outer:

relation["type"="multipolygon"](52.51,13.36,52.52,13.39) -> .relation;
way(r.relation:"outer")["building"]; 
out qt;

Overpass Turbo link 1

Then you asked "How can I remove the ones the are set to role: "outer"?"

You can use the difference operator for this purpose:

relation["type"="multipolygon"](52.51,13.36,52.52,13.39) -> .relation;
( way(r.relation)["building"]; -
  way(r.relation:"outer"); );
out qt;

Overpass Turbo link 2

BTW: Don't forget to also check out the documentation on the Wiki page

answered 26 Jul '14, 22:00

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

edited 26 Jul '14, 22:17

Source code available on GitHub .