Tuesday, 11 June 2019

How to use union in area queries (QL/XML) with Overpass API/OpenStreetMaps?


I am using area queries to find nodes with particular amenities Eg:-


[out:json]; 

area[name = "New York"];
node(area)[amenity=bar];
out;

However the issue with this is that if I query the following:


[out:json]; 
area[name = "New York"];
(
node(area)[amenity=bar];
node(area)[amenity=restaurant];

);
out;

The output includes only the first amenity, i.e. 'bar' even though there's a union. If I reverse the order to put 'restaurant' before 'bar' the output includes only restaurants. I also tried the same using XML syntax but in vain. Any ideas?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...