Stefan,

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.

 
[out:json]
[timeout:25]
;

  node["shop"~"dairy"]  
(45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);
out meta;
  way["shop"~"dairy"]  
(45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);
out meta center qt;


Pierre 



________________________________
 De : Stefan Keller <[email protected]>
À : Talk Openstreetmap <[email protected]> 
Cc : Roland Olbricht <[email protected]> 
Envoyé le : Jeudi 24 juillet 2014 8h19
Objet : [OSM-talk] Overpass API / Overpass QL: center (and centroid)    
function?
 

Hi,

I'm trying to get a list of point features only (as GeoJSON or XML).
This could serve as input e.g. to uMap. The problem is that the query
returns points but also areas. This is actually correct - but I want
these areas converted to point geometries too (centered, like
ST_Centroid).

I then found the modifcator/keyword "center" in the Overpass QL [1].
But I still get polygons. See the query [2] below.

Any ideas?

--Stefan


[1] http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL

[2] http://overpass-turbo.osm.ch/ oder http://overpass-turbo.eu/

*** Dairy (Käserei) Query ways/areas only... ***

[out:json]
[timeout:25]
;
(
  node["shop"~"dairy"]
  (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);
  way["shop"~"dairy"]
  (45.70234306798271,5.8831787109375,47.864773955792245,10.590820312499998);
);
out meta center qt;
>;
out meta center qt;

_______________________________________________
talk mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/talk
_______________________________________________
talk mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/talk

Reply via email to