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...

asked 06 Mar '16, 17:53

Shazard's gravatar image

accept rate: 0%

edited 06 Mar '16, 17:55

scai's gravatar image

scai ♦

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

(07 Mar '16, 06:46) escada

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.

permanent link

answered 08 Mar '16, 13:15

Sanderd17's gravatar image

accept rate: 33%

Your answer
toggle preview

Follow this question

By Email:




Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • numbered list: 1. Foo 2. Bar
  • basic HTML tags are also supported

Question tags:


question asked: 06 Mar '16, 17:53

question was seen: 1,644 times

last updated: 08 Mar '16, 13:15

powered by OSQA