<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, <br 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=""><br 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 example, the parenthesis are making a union of the two requests. and the greater then ( > ) is doing a recurse request.</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="">This example below is working. It extract independantly nodes and ways, calculating the centroid for the ways.<br></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="">[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=""></span></div><div 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> Pierre Béland <pierzenh@yahoo.fr> <br style="" class=""><b style="" class=""><span class="" style="font-weight: bold;">Cc :</span></b> Talk Openstreetmap <talk@openstreetmap.org> <br style="" class=""> <b style="" class=""><span class="" style="font-weight: bold;">Envoyé le :</span></b> Jeudi 24 juillet 2014 9h44<br style="" class=""> <b style="" class=""><span class=""
 style="font-weight: bold;">Objet :</span></b> Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?<br style="" class=""> </font> </div> <div style="" class=""><br style="" class="">Salut Pierre<br style="" class="" clear="none"><br style="" class="" clear="none">Thanks - But this doesn't parse (see below). I'm getting:<br style="" class="" clear="none">Error: line 4: static error: Element "print" cannot be subelement of<br style="" class="" clear="none">element "union".<br style="" class="" clear="none"><br style="" class="" clear="none">-- Stefan<br style="" class="" clear="none"><br style="" class="" clear="none">[out:json]<br style="" class="" clear="none">[timeout:25]<br style="" class="" clear="none">;<br style="" class="" clear="none">(<br style="" class="" clear="none">  node["shop"~"dairy"]<br style="" class="" clear="none">  (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);<br
 style="" class="" clear="none">  way["shop"~"dairy"]<br style="" class="" clear="none">  (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);<br style="" class="" clear="none">  out meta center;<br style="" class="" clear="none">);<br style="" class="" clear="none">>;<br style="" class="" clear="none">out meta qt;<br style="" class="" clear="none"><div style="" class="" id="yqtfd42505"><br style="" class="" clear="none">2014-07-24 15:20 GMT+02:00 Pierre Béland <<a style="" class="" shape="rect" ymailto="mailto:pierzenh@yahoo.fr" href="mailto:pierzenh@yahoo.fr">pierzenh@yahoo.fr</a>>:<br style="" class="" clear="none">> Stefan,<br style="" class="" clear="none">><br style="" class="" clear="none">> In your request, you make a recursive query that loads nodes from the way.<br style="" class="" clear="none">> In this example, the node and way queries are independant. For the way, the<br style=""
 class="" clear="none">> center command is used.<br style="" class="" clear="none">><br style="" class="" clear="none">> [out:json]<br style="" class="" clear="none">> [timeout:25]<br style="" class="" clear="none">><br style="" class="" clear="none">> ;<br style="" class="" clear="none">><br style="" class="" clear="none">>   node["shop"~"dairy"]<br style="" class="" clear="none">> (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);<br style="" class="" clear="none">> out meta;<br style="" class="" clear="none">><br style="" class="" clear="none">>   way["shop"~"dairy"]<br style="" class="" clear="none">> (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);<br style="" class="" clear="none">> out meta center qt;<br style="" class="" clear="none">><br style="" class="" clear="none">> Pierre<br style="" class="" clear="none">><br style="" class=""
 clear="none">> ________________________________<br style="" class="" clear="none">> De : Stefan Keller <<a style="" class="" shape="rect" ymailto="mailto:sfkeller@gmail.com" href="mailto:sfkeller@gmail.com">sfkeller@gmail.com</a>><br style="" class="" clear="none">> À : Talk Openstreetmap <<a style="" class="" shape="rect" ymailto="mailto:talk@openstreetmap.org" href="mailto:talk@openstreetmap.org">talk@openstreetmap.org</a>><br style="" class="" clear="none">> Cc : Roland Olbricht <<a style="" class="" shape="rect" ymailto="mailto:roland.olbricht@gmx.de" href="mailto:roland.olbricht@gmx.de">roland.olbricht@gmx.de</a>><br style="" class="" clear="none">> Envoyé le : Jeudi 24 juillet 2014 8h19<br style="" class="" clear="none">> Objet : [OSM-talk] Overpass API / Overpass QL: center (and centroid)<br style="" class="" clear="none">> function?<br style="" class="" clear="none">><br style="" class=""
 clear="none">> Hi,<br style="" class="" clear="none">><br style="" class="" clear="none">> I'm trying to get a list of point features only (as GeoJSON or XML).<br style="" class="" clear="none">> This could serve as input e.g. to uMap. The problem is that the query<br style="" class="" clear="none">> returns points but also areas. This is actually correct - but I want<br style="" class="" clear="none">> these areas converted to point geometries too (centered, like<br style="" class="" clear="none">> ST_Centroid).<br style="" class="" clear="none">><br style="" class="" clear="none">> I then found the modifcator/keyword "center" in the Overpass QL [1].<br style="" class="" clear="none">> But I still get polygons. See the query [2] below.<br style="" class="" clear="none">><br style="" class="" clear="none">> Any ideas?<br style="" class="" clear="none">><br style="" class="" clear="none">> --Stefan<br style=""
 class="" clear="none">><br style="" class="" clear="none">><br style="" class="" clear="none">> [1] <a style="" class="" shape="rect" 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="" clear="none">><br style="" class="" clear="none">> [2] <a style="" class="" shape="rect" href="http://overpass-turbo.osm.ch/" target="_blank">http://overpass-turbo.osm.ch/ </a>oder <a style="" class="" shape="rect" href="http://overpass-turbo.eu/" target="_blank">http://overpass-turbo.eu/</a><br style="" class="" clear="none">><br style="" class="" clear="none">> *** Dairy (Käserei) Query ways/areas only... ***<br style="" class="" clear="none">><br style="" class="" clear="none">> [out:json]<br style="" class="" clear="none">> [timeout:25]<br style="" class="" clear="none">> ;<br style="" class="" clear="none">> (<br
 style="" class="" clear="none">>   node["shop"~"dairy"]<br style="" class="" clear="none">>   (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);<br style="" class="" clear="none">>   way["shop"~"dairy"]<br style="" class="" clear="none">>   (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);<br style="" class="" clear="none">> );<br style="" class="" clear="none">> out meta center qt;<br style="" class="" clear="none">>>;<br style="" class="" clear="none">> out meta center qt;<br style="" class="" clear="none">><br style="" class="" clear="none">> _______________________________________________<br style="" class="" clear="none">> talk mailing list<br style="" class="" clear="none">> <a style="" class="" shape="rect" ymailto="mailto:talk@openstreetmap.org" href="mailto:talk@openstreetmap.org">talk@openstreetmap.org</a><br style="" class=""
 clear="none">> <a style="" class="" shape="rect" href="https://lists.openstreetmap.org/listinfo/talk" target="_blank">https://lists.openstreetmap.org/listinfo/talk</a><br style="" class="" clear="none">><br style="" class="" clear="none">></div><br style="" class=""><br style="" class=""></div> </div> </div>  </div></body></html>