[OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
Pierre Béland
pierzenh at yahoo.fr
Thu Jul 24 13:20:44 UTC 2014
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 <sfkeller at gmail.com>
À : Talk Openstreetmap <talk at openstreetmap.org>
Cc : Roland Olbricht <roland.olbricht at gmx.de>
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
talk at openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk
-------------- section suivante --------------
Une pi?ce jointe HTML a ?t? nettoy?e...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20140724/020556d6/attachment.html>
More information about the talk
mailing list