I need to find in Italy all the intersecting polygons of:

  • all airport terminals of the tag["aeroway"="terminal"] that are inside only international airports of the tag["aerodrome"="international"]

I have reached this level:

 (way(area.boundaryarea)["aerodrome"="international"];  rel(area.boundaryarea)["aerodrome"="international"];)->.a;
 (way(area.boundaryarea)["aeroway"="terminal"];  rel(area.boundaryarea)["aeroway"="terminal"];)->.b;

 (rel.a.b;  way.a.b;);
/*added by auto repair*/
/*end of auto repair*/
out meta;

but still it does not show the intersections but not the union and it shows me the intersection between all.

  • It is unclear to me what you want to find. Can you include (or link) sketch of what you want to find (may be in Paint) or link existing OSM object fitting your query? – reducing activity Sep 20 '18 at 16:47
  • @Mateusz Konieczny the answer below explains everything :) – Ahmed Essam Sep 25 '18 at 8:42

For "object inside another object" queries, an Overpass API specific object type called "area" needs to be used.

To avoid having an overly complex query, we will skip the "Italy" restriction for the moment, and use a bounding box instead. In the first step, we look for all ways and relations with "aerodrome"="international" (nodes are not relevant here), and determine the corresponding Overpass API via a call to map_to_area.

By adding (area) in the next line, we can leverage this area to restrict any "aeroway"="terminal" to the relevant ones in the area in question.

out geom;

Try it in overpass turbo: https://overpass-turbo.eu/s/C9g

Restricted to Italy only:

out geom;
| improve this answer | |
  • Thats exactly what I was looking for. Thank you very much. Regarding adding Italy as a restriction, is it possible ? – Ahmed Essam Sep 23 '18 at 21:51
  • Sure, that's also possible, I added the respective queries. – mmd Sep 24 '18 at 11:55

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.