<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div style="" class=""><span style="" class="">Stefan,</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br style="" class=""><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><span style="" class="">In your request, you make a recursive query that loads nodes from the way. In this example, the node and way queries are independant. For the way, the center command is
used.<br style="" class=""></span></div><div style="" class=""> <br style="" class="">[out:json]<br style="" class="">[timeout:25]<br style="" class="">;<br style="" class=""><br style="" class=""> node["shop"~"dairy"] (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);<br style="" class="">out meta;<br style="" class=""> way["shop"~"dairy"] (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);<br style="" class="">out meta center qt;<br style="" class=""><br style="" class=""></div><div style="" class=""><span class="" style="font-style:italic;color:rgb(0, 0, 191);font-weight:bold;">Pierre <br style="" class=""></span><br style="" class=""></div> <div class="" style="font-family: HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 10pt;"> <div class="" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica,
Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="" class="" dir="ltr"> <hr style="" class="" size="1"> <font style="" class="" face="Arial" size="2"> <b style="" class=""><span class="" style="font-weight:bold;">De :</span></b> Stefan Keller <sfkeller@gmail.com><br style="" class=""> <b style="" class=""><span class="" style="font-weight: bold;">À :</span></b> Talk Openstreetmap <talk@openstreetmap.org> <br style="" class=""><b style="" class=""><span class="" style="font-weight: bold;">Cc :</span></b> Roland Olbricht <roland.olbricht@gmx.de> <br style="" class=""> <b style="" class=""><span class="" style="font-weight: bold;">Envoyé le :</span></b> Jeudi 24 juillet 2014 8h19<br style="" class=""> <b style="" class=""><span class="" style="font-weight: bold;">Objet :</span></b> [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?<br style="" class=""> </font> </div> <div style=""
class=""><br style="" class="">Hi,<br style="" class=""><br style="" class="">I'm trying to get a list of point features only (as GeoJSON or XML).<br style="" class="">This could serve as input e.g. to uMap. The problem is that the query<br style="" class="">returns points but also areas. This is actually correct - but I want<br style="" class="">these areas converted to point geometries too (centered, like<br style="" class="">ST_Centroid).<br style="" class=""><br style="" class="">I then found the modifcator/keyword "center" in the Overpass QL [1].<br style="" class="">But I still get polygons. See the query [2] below.<br style="" class=""><br style="" class="">Any ideas?<br style="" class=""><br style="" class="">--Stefan<br style="" class=""><br style="" class=""><br style="" class="">[1] <a style="" class="" href="http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL"
target="_blank">http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL</a><br style="" class=""><br style="" class="">[2] <a style="" class="" href="http://overpass-turbo.osm.ch/" target="_blank">http://overpass-turbo.osm.ch/ </a>oder <a style="" class="" href="http://overpass-turbo.eu/" target="_blank">http://overpass-turbo.eu/</a><br style="" class=""><br style="" class="">*** Dairy (Käserei) Query ways/areas only... ***<br style="" class=""><br style="" class="">[out:json]<br style="" class="">[timeout:25]<br style="" class="">;<br style="" class="">(<br style="" class=""> node["shop"~"dairy"]<br style="" class=""> (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);<br style="" class=""> way["shop"~"dairy"]<br style="" class=""> (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);<br style="" class="">);<br style="" class="">out meta center qt;<br style="" class="">>;<br
style="" class="">out meta center qt;<br style="" class=""><br style="" class="">_______________________________________________<br style="" class="">talk mailing list<br style="" class=""><a style="" class="" ymailto="mailto:talk@openstreetmap.org" href="mailto:talk@openstreetmap.org">talk@openstreetmap.org</a><br style="" class=""><a style="" class="" href="https://lists.openstreetmap.org/listinfo/talk" target="_blank">https://lists.openstreetmap.org/listinfo/talk</a><br style="" class=""><br style="" class=""><br style="" class=""></div> </div> </div> </div></body></html>