0

Hello I am new to OpenStreatMap and Overpass API.

I would like to make a query in such a way that I can specify an airport name (for example: wien flughafen austria or the ICAO code) and get nodes, ways and relations about the taxiway, taxilane and parking_position.

I was able to achieve this by using the osmnx python package by typing:

G = ox.graph_from_place('wien flughafen austria',
                        infrastructure='way["aeroway"]',
                        simplify=False,
                        custom_filter = ('["aeroway"~"taxiway|taxilane|parking_position"]'))

However I would like to do it using the Overpass API. I know that a way to make more specific queries is by using http://overpass-turbo.eu/ interface.

The maximum I was able to achieve was by typing:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“aeroway=aerodrome and icao~=LOWW global”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “aeroway=aerodrome and icao~LOWW”
  node["aeroway"="aerodrome"]["icao"~"LOWW"];
  way["aeroway"="aerodrome"]["icao"~"LOWW"];
  relation["aeroway"="aerodrome"]["icao"~"LOWW"];
);
// print results
out body;
>;
out skel qt;

This however does not contain information about the taxiway, taxilane and parking_position.

Would you be able to suggest the right way to make the query please?

2
  • osmnx calls Overpass API (and probably also Nominatim) behind the scenes.Why don't you check what exactly osmnx is doing, rather than trying some random queries on your own in overpass turbo? – mmd Mar 5 '20 at 10:19
  • @mmd thanks for the contribution but I was not able to understand it well enough as i am very new to OSM and the way of making queries is very cryptic to me. Would you be able to share a possible answer in order to achieve my goal? – Federico Gentile Mar 5 '20 at 12:57
0

I was able to achieve my goal in overpass turbo by using the following lines of code:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“taxiway in airport ”
*/
[out:xml]/*fixed by auto repair*/[timeout:25];
// fetch area “airport” to search in
{{geocodeArea:LOWW}}->.searchArea;
// gather results
(
  // query part for: “aerodrome”
  node["aeroway"="aerodrome"](area.searchArea);
  way["aeroway"="aerodrome"](area.searchArea);
  relation["aeroway"="aerodrome"](area.searchArea);

  // query part for: “taxiway”
  node["aeroway"="taxiway"](area.searchArea);
  way["aeroway"="taxiway"](area.searchArea);
  relation["aeroway"="taxiway"](area.searchArea);

  // query part for: “taxilane”
  node["aeroway"="taxilane"](area.searchArea);
  way["aeroway"="taxilane"](area.searchArea);
  relation["aeroway"="taxilane"](area.searchArea);

  // query part for: “parking_position”
  node["aeroway"="parking_position"](area.searchArea);
  way["aeroway"="parking_position"](area.searchArea);
  relation["aeroway"="parking_position"](area.searchArea);

);
// print results
out meta;/*fixed by auto repair*/
>;
out meta qt;/*fixed by auto repair*/

EDIT: to make it work with overpy just run:

import overpy
api = overpy.Overpass()
r = api.query("""
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“taxiway in airport ”
*/
[out:xml]/*fixed by auto repair*/[timeout:25];
// fetch area “airport” to search in
area[icao~"LOWW"]->.searchArea;
// gather results
(
  // query part for: “aerodrome”
  node["aeroway"="aerodrome"](area.searchArea);
  way["aeroway"="aerodrome"](area.searchArea);
  relation["aeroway"="aerodrome"](area.searchArea);

  // query part for: “taxiway”
  node["aeroway"="taxiway"](area.searchArea);
  way["aeroway"="taxiway"](area.searchArea);
  relation["aeroway"="taxiway"](area.searchArea);

  // query part for: “taxilane”
  node["aeroway"="taxilane"](area.searchArea);
  way["aeroway"="taxilane"](area.searchArea);
  relation["aeroway"="taxilane"](area.searchArea);

  // query part for: “parking_position”
  node["aeroway"="parking_position"](area.searchArea);
  way["aeroway"="parking_position"](area.searchArea);
  relation["aeroway"="parking_position"](area.searchArea);

);
// print results
out meta;/*fixed by auto repair*/
>;
out meta qt;/*fixed by auto repair*/
""")
4
  • To answer your question: it doesn't work with overpy because {{geocodeArea:LOWW}} is syntactic sugar introduced by overpass turbo, that it unknown to overpy. Read more about it here: wiki.openstreetmap.org/wiki/Overpass_turbo/… – mmd Mar 5 '20 at 13:37
  • Do you know what i can write instead of it please? – Federico Gentile Mar 5 '20 at 14:05
  • 1
    According to the documentation, overpass turbo resolves LOWW via Nominatim, and replaces it by area(2475732093)->.searchArea;. You would have to re-implement something similar, or query the area by tag: area[icao~"LOWW"]. It's important to understand that overpass turbo combines different sources here, which are not all available if you're directly calling Overpass API. – mmd Mar 5 '20 at 14:39
  • Awesome thanks a lot !! – Federico Gentile Mar 5 '20 at 16:53

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.