0

In osm, is it possible to limit a overpassApi request into a geographic border ? For example, the following request is restricted into a polygon (line 3). What can i do to limit it in a osm relation (for example rel °62508 : Bonn) ?

<query type="node">
  <has-kv k="amenity" v="drinking_water"/>
    <bbox-query e="7.25" n="50.8" s="50.7" w="7.1"/>
</query>
<print/>
user2866768
  • 3
  • 1
  • 2

1 Answers1

1

Please see sections 'All data in a bounding box' and 'Select region by polygon' : http://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide

MaM
  • 2,043
  • 10
  • 20
  • 1
    one can also query for stuff in an `area` defined by an OSM relation, using the `area-query` statement. Take a look at [this example](https://github.com/tyrasd/overpass-ide/blob/d5a6465ef5d177cc9be1f662021ec7e22cc06960/examples.md#platforms-in-bozen) – tyr May 13 '14 at 10:37
  • @tyr Unfortunately the example doesn't explain why *Bozen* has the area ID *3600047207* and how it can be determined for other areas. – scai May 13 '14 at 12:14
  • For that you need to run trough the data with a query like "look for boundary with name='bozen'". If you want to have more tollerant search, you might run into the *geocoding* topic and play around with http://nominatim.osm.org – MaM May 13 '14 at 14:26
  • 3
    @scai yes, indeed. It's an old example, but I couldn't find a better one quickly :X Actually, for OP's question, I would recommend to use [overpass turbo](http://overpass-turbo.eu)'s wizard with something like `amenity=drinking_water in Bonn` - then overpass turbo does the geocoding and id-fiddling job for you. – tyr May 13 '14 at 14:41
  • Yes. But for the reference: the *area* ID is the *relation* ID + *3600000000* (is this anywhere documented in the wiki? :/) – scai May 13 '14 at 16:03
  • Documentation on how to determine that integer ID are here: http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Query_for_areas_.28is_in.29 – Glenn Plas Aug 23 '14 at 14:59
  • For first experiments you can try Overpass turbo with comfortable bbox viewport support : http://overpass-turbo.eu/ – MaM Aug 23 '14 at 15:01