[OSM-dev] Overpass API: Getting nodes together with centroids of areas ("POI query")?

Stefan Keller sfkeller at gmail.com
Sat Oct 18 13:54:28 UTC 2014


Hi,

A typical query gives all 1. nodes, 2. ways and 3. areas with
"tourism=zoo” (see below).

But I'd like to get back only point geometries which consist of 1.
nodes together with (union) 2. centroids calculated on the fly from
areas. I coined this a "POI query".

Possible?

Yours, S.


<!--
This has been generated by the overpass-turbo wizard.
Get all nodes, ways and areas with "tourism=zoo”
-->
<osm-script output="json" timeout="25">
  <!-- gather results -->
  <union>
    <!-- query part for: “tourism=zoo” -->
    <query type="node">
      <has-kv k="tourism" v="zoo"/>
      <bbox-query {{bbox}}/>
    </query>
    <query type="way">
      <has-kv k="tourism" v="zoo"/>
      <bbox-query {{bbox}}/>
    </query>
    <query type="relation">
      <has-kv k="tourism" v="zoo"/>
      <bbox-query {{bbox}}/>
    </query>
  </union>
  <!-- print results -->
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>



More information about the dev mailing list