Hi, I am new to overpass api. This is my query: (node(around:2000,57.179,24.709)["amenity"];way(around:2000,57.179,24.709)["amenity"];way(around:2000,57.179,24.709)["natural"];way(around:2000,57.179,24.709)["landuse"~"forest|grass"];);(._;>;);out body; What I am wandering is that I need 4 times to repeat around command. What I want is to have my location, and have all naturals and amenities (landuse=forest or grass) as well around my location. Isn't there more effective way to make the same query... Also I would prefer buildings, but when I add buildings, then the query runs long time... |
This is not possible in Overpass API, but it is possible in Overpass Turbo (which is just some sort of IDE written around Overpass API). Overpass Turbo allows you to define "shortcuts" that you can use to refer to a common query part. See the example here: http://overpass-turbo.eu/s/eQU (it creates a new shortcut names "area" that uses the definition of that "around" command). However, if you want to execute the query on a regular Overpass API server (f.e. via a http request on a webpage), you must get rid of these shortcuts again. You can get a valid Overpass API query by using one of the export options in Overpass Turbo. answered 08 Mar '16, 13:15 Sanderd17 |
You need to repeat your location as you make the union of 4 different queries. I guess you speed it up a bit by dropping the parts where you look for landuse points (or building points), as most of them will be mapped as areas. OTOH, you should include relations in your query, in order to obtain the multi-polygons