[OSM-talk] Accessing "center" feature from Overpass XML?

Martin Raifer tyr.asd at gmail.com
Fri Oct 10 06:48:59 UTC 2014

The syntax looks like the following in Overpass-XML:

    <print mode="meta" geometry="center"/>

For the geometry parameter one has the options "center", "bounds",
"full" and "skeleton" (=regular osm xml without added geometry data).
If you are only interested in center coordinates for some objects, you
probably want to drop the two lines after your first print statement
(the recurse and additional print are normally there to grab the
object's geometry).

On Thu, Oct 9, 2014 at 11:55 PM, Bryce Nesbitt <bryce2 at obviously.com> wrote:
> I know how to use "out meta center;" in Overpass query language to get
> the center of a way.
> What's the equivalent in Overpass XML?  I tried adding it to the
> <print>, but I can't find documentation on <print> and the command is
> rejected:
> <osm-script output="xml" timeout="25">
>   <union>
>     <query type="node">
>       <has-kv k="amenity" v="toilets"/>
>       <bbox-query {{bbox}}/>
>     </query>
>     <query type="way">
>       <has-kv k="amenity" v="toilets"/>
>       <bbox-query {{bbox}}/>
>     </query>
>   </union>
>   <print mode="meta center"/>
>   <recurse type="down"/>
>   <print mode="meta center" order="quadtile"/>
> </osm-script>
> _______________________________________________
> talk mailing list
> talk at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/talk

More information about the talk mailing list