[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


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".


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 -->
    <!-- query part for: “tourism=zoo” -->
    <query type="node">
      <has-kv k="tourism" v="zoo"/>
      <bbox-query {{bbox}}/>
    <query type="way">
      <has-kv k="tourism" v="zoo"/>
      <bbox-query {{bbox}}/>
    <query type="relation">
      <has-kv k="tourism" v="zoo"/>
      <bbox-query {{bbox}}/>
  <!-- print results -->
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>

More information about the dev mailing list