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

I'm trying to build a query to download data (for example parks) from different bbox (can't be substituted by nominatim) by overpass-turbo. Here my query but it doesn't work:

 <osm-script output="json" timeout="50">
  <!-- fetch area to search in -->
  <union into="area">
    <bbox-query e="20" n="30" s="28" w="18"/>
    <bbox-query e="30" n="40" s="38" w="28"/>
    <bbox-query e="40" n="50" s="48" w="38"/>
  </union>
  <!-- gather results -->
  <union>
    <!-- query part for: “leisure=park” -->
    <query type="node">
      <has-kv k="leisure" v="park"/>
      <area-query from="area"/>
    </query>
    <query type="way">
      <has-kv k="leisure" v="park"/>
      <area-query from="area"/>
    </query>
    <query type="relation">
      <has-kv k="leisure" v="park"/>
      <area-query from="area"/>
    </query>
  </union>
  <!-- print results -->
  <print from="area" geometry="skeleton" mode="body" order="id"/>
 <!-- <recurse type="down"/> -->
  <print from="area" geometry="skeleton" mode="skeleton" order="quadtile" />
</osm-script>

Please help to fix it. I can't find suitable solution in documentation on wiki and here in previous questions.

asked 03 May '17, 14:29

seevgenia's gravatar image

seevgenia
26114
accept rate: 0%

edited 03 May '17, 14:36


In the non XML query language you can pass a bbox to a filter:

http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Bounding_box

I don't know if there is an equivalent in the XML. In any case, a union of such queries should work for your query:

(
node(50.6,7.0,50.8,7.3)[leisure=park];
way(50.6,7.0,50.8,7.3)[leisure=park];
rel(50.6,7.0,50.8,7.3)[leisure=park];
node(51.6,7.0,51.8,7.3)[leisure=park];
way(51.6,7.0,51.8,7.3)[leisure=park];
rel(51.6,7.0,51.8,7.3)[leisure=park];
);
permanent link

answered 03 May '17, 17:04

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

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:

×710
×483
×228
×147
×30

question asked: 03 May '17, 14:29

question was seen: 3,694 times

last updated: 03 May '17, 17:04

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