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

i want to gather results with a search-request - suggested by the wiki.-page

btw see the central ressource for the tag-system http://wiki.openstreetmap.org/wiki/Tag:amenity%3Dschool

on overpass-api we can run this - as request for node, builiding and relaion:

<!--
This query looks for nodes, ways and relations 
with the given key/value combination.
Choose your region and hit the Run button above!
-->
<osm-script output="json" timeout="25">
  <!-- gather results -->
  <union>
    <!-- query part for: “building=school” -->
    <query type="node">
      <has-kv k="building" v="school"/>
      <bbox-query {{bbox}}/>
    </query>
    <query type="way">
      <has-kv k="building" v="school"/>
      <bbox-query {{bbox}}/>
    </query>
    <query type="relation">
      <has-kv k="building" v="school"/>
      <bbox-query {{bbox}}/>
    </query>
  </union>
  <!-- print results -->
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

btw - this above code does not function - and this below also not. what is wrong here?

This query looks for nodes, ways and relations 
with the given key/value combination.
Choose your region and hit the Run button above!
-->
<osm-script output="json" timeout="25">
  <!-- gather results -->
  <union>
    <!-- query part for: “building=school” -->
    <query type="node">
      <has-kv k="building" v="school"/>
      <bbox-query {51.5557914,0.2118915,51.5673083,0.2369398}/>
    </query>
  <!-- print results -->
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

why does this not run smoothly?

asked 21 Jun '14, 07:23

say_hello_to_the_world's gravatar image

say_hello_to...
19232427
accept rate: 0%


The first query runs fine, see the result on overpass turbo.

The second query is broken. The bbox element has the wrong syntax and the union is not closed. I fixed it for you. See the result on overpass turbo, the fixed query is:

<osm-script output="json" timeout="25">
  <!-- gather results -->
  <union>
    <!-- query part for: “building=school” -->
    <query type="node">
      <has-kv k="building" v="school"/>
      <bbox-query e="51.5557914" s="0.2118915" w="51.5673083" n="0.2369398"/>
    </query>
  </union>
  <!-- print results -->
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

Try to use overpass turbo when constructing queries. It will show you a graphical representation of the results and syntax errors can be spotted easily.

permanent link

answered 21 Jun '14, 08:25

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

hello dear scai - many thanks for the help - all is greatly apprediated. thx again - have agreat weekend ;-)

(21 Jun '14, 12:02) say_hello_to...
1

Please accept answers (by clicking on the checkmark) if they answer your questions. So far you have a lot of questions but didn't accept a single answer.

(21 Jun '14, 12:09) scai ♦
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:

×710
×622
×483
×84
×34

question asked: 21 Jun '14, 07:23

question was seen: 5,502 times

last updated: 21 Jun '14, 12:09

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