NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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

Shazard
11112
accept rate: 0%

edited 06 Mar '16, 17:55

scai's gravatar image

scai ♦
33.3k21309459

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

Sanderd17
1.1k51637
accept rate: 31%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×94
×20

question asked: 06 Mar '16, 17:53

question was seen: 3,372 times

last updated: 08 Mar '16, 13:15

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum