I could able to retrieve data using BoundingBoxes or GeocodeArea using over-pass API. While i want to get specific information from particular GeocodeArea i use

 {{geocodeArea:India}}->.searchArea;

For BoundingBoxes I use like

  node["leisure"="park"](50.6,7.0,50.8,7.3);

How Can i prepare Overpass query condition that satisfies both BBox & GeocodeArea. Any Examples? Any Help would be appreciated.

asked 05 Dec '15, 11:00

suri1983's gravatar image

suri1983
31113
accept rate: 0%

edited 05 Dec '15, 11:01

As far as I know you can only limit one query by either bbox or area parameter ... there is no combination feature in overpass-api documentation.

But maybe you can do a difference between one result from the other and get a result you want. See http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Difference

(07 Dec '15, 17:11) stephan75

You can simply combine multiple filters in one query statement. In the following example we're looking for all pubs in Cologne (inside relation 62578), which in addition are inside a given bounding box. The resulting query should look like this:

area(3600062578)->.searchArea;
node
  ["amenity"="pub"]
  (area.searchArea)
  (50.91928498040378,6.7814483642578125,51.03858753963086,6.8932342529296875);
out body;

Overpass Turbo Link: http://overpass-turbo.eu/s/ddV

If you leave out the (area.searchArea) line in overpass turbo, you'll notice some additional pubs, whcih are inside the bounding box, but not in the Cologne area.

permanent link

answered 11 Dec '15, 17:32

mmd's gravatar image

mmd
5.6k4988
accept rate: 37%

edited 11 Dec '15, 17:36

Thank you all. Its kind of fun with OSM.

(12 Dec '15, 18:14) suri1983
1

@mmd, may i know why is the 36000 number is prefixed with relation id?

(27 May '16, 10:12) yogi_ks
2

@yogi_ks: it's simply a convention which is only used for Overpass API: read more about it on the wiki page.

By convention the area id can be calculated from an existing OSM way by adding 2400000000 to its OSM id, or in case of a relation by adding 3600000000 respectively

(27 May '16, 11:43) mmd

@mmd: thank you for the explanation.

(27 May '16, 12:11) yogi_ks
Your answer
toggle preview

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:

×125
×120

question asked: 05 Dec '15, 11:00

question was seen: 3,672 times

last updated: 27 May '16, 12:11

powered by OSQA