I am using overpy
to collect data information about taxiways, taxilanes and parking positions of an airport (icao code LOWW). I was able to achieve my goal I wrote the following lines of code:
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*/
""")
However my goal is to save the response into the .osm file format. Unfortunately i cannot find in the overpy
documentation a way to do it.
Would you be able to suggest a way to achieve my goal?
NOTE: I was thinking to use other packages as well such as osmnx
but i cannot get the query as right as with overpy.
import osmnx as ox
G = ox.graph_from_place('wien flughafen austria', infrastructure='way["aeroway"]',simplify=False, custom_filter = ('["aeroway"~"taxiway|taxilane|parking_position"]'))
ox.save_load.save_as_osm(G, filename='filename.osm')