Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
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.59082031248); out meta; way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center qt; Pierre De : Stefan Keller sfkel...@gmail.com À : Talk Openstreetmap talk@openstreetmap.org Cc : Roland Olbricht roland.olbri...@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.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); ); out meta center qt; ; out meta center qt; ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
Salut Pierre Thanks - But this doesn't parse (see below). I'm getting: Error: line 4: static error: Element print cannot be subelement of element union. -- Stefan [out:json] [timeout:25] ; ( node[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center; ); ; out meta qt; 2014-07-24 15:20 GMT+02:00 Pierre Béland pierz...@yahoo.fr: 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.59082031248); out meta; way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center qt; Pierre De : Stefan Keller sfkel...@gmail.com À : Talk Openstreetmap talk@openstreetmap.org Cc : Roland Olbricht roland.olbri...@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.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); ); out meta center qt; ; out meta center qt; ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
Stefan, In your example, the parenthesis are making a union of the two requests. and the greater then ( ) is doing a recurse request. This example below is working. It extract independantly nodes and ways, calculating the centroid for the ways. [out:json] [timeout:25] ; node[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta; way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center qt; Pierre De : Stefan Keller sfkel...@gmail.com À : Pierre Béland pierz...@yahoo.fr Cc : Talk Openstreetmap talk@openstreetmap.org Envoyé le : Jeudi 24 juillet 2014 9h44 Objet : Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function? Salut Pierre Thanks - But this doesn't parse (see below). I'm getting: Error: line 4: static error: Element print cannot be subelement of element union. -- Stefan [out:json] [timeout:25] ; ( node[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center; ); ; out meta qt; 2014-07-24 15:20 GMT+02:00 Pierre Béland pierz...@yahoo.fr: 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.59082031248); out meta; way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center qt; Pierre De : Stefan Keller sfkel...@gmail.com À : Talk Openstreetmap talk@openstreetmap.org Cc : Roland Olbricht roland.olbri...@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.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); ); out meta center qt; ; out meta center qt; ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
Thanks again - I think I got it - including a bug: GeoJSON is still returning polygons! But with XML it works. E.g. replacing [out:json] with [out:xml] or exporting as XML. --Stefan 2014-07-24 15:48 GMT+02:00 Pierre Béland pierz...@yahoo.fr: Stefan, In your example, the parenthesis are making a union of the two requests. and the greater then ( ) is doing a recurse request. This example below is working. It extract independantly nodes and ways, calculating the centroid for the ways. [out:json] [timeout:25] ; node[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta; way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center qt; Pierre De : Stefan Keller sfkel...@gmail.com À : Pierre Béland pierz...@yahoo.fr Cc : Talk Openstreetmap talk@openstreetmap.org Envoyé le : Jeudi 24 juillet 2014 9h44 Objet : Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function? Salut Pierre Thanks - But this doesn't parse (see below). I'm getting: Error: line 4: static error: Element print cannot be subelement of element union. -- Stefan [out:json] [timeout:25] ; ( node[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center; ); ; out meta qt; 2014-07-24 15:20 GMT+02:00 Pierre Béland pierz...@yahoo.fr: 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.59082031248); out meta; way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center qt; Pierre De : Stefan Keller sfkel...@gmail.com À : Talk Openstreetmap talk@openstreetmap.org Cc : Roland Olbricht roland.olbri...@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.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); ); out meta center qt; ; out meta center qt; ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
In my last overpass test with the new out center feature, it looked like it was working only with XML output, not with the JSON (not GeoJSON) one. 2014-07-24 16:30 GMT+02:00 Stefan Keller sfkel...@gmail.com: Thanks again - I think I got it - including a bug: GeoJSON is still returning polygons! But with XML it works. E.g. replacing [out:json] with [out:xml] or exporting as XML. --Stefan 2014-07-24 15:48 GMT+02:00 Pierre Béland pierz...@yahoo.fr: Stefan, In your example, the parenthesis are making a union of the two requests. and the greater then ( ) is doing a recurse request. This example below is working. It extract independantly nodes and ways, calculating the centroid for the ways. [out:json] [timeout:25] ; node[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta; way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center qt; Pierre De : Stefan Keller sfkel...@gmail.com À : Pierre Béland pierz...@yahoo.fr Cc : Talk Openstreetmap talk@openstreetmap.org Envoyé le : Jeudi 24 juillet 2014 9h44 Objet : Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function? Salut Pierre Thanks - But this doesn't parse (see below). I'm getting: Error: line 4: static error: Element print cannot be subelement of element union. -- Stefan [out:json] [timeout:25] ; ( node[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center; ); ; out meta qt; 2014-07-24 15:20 GMT+02:00 Pierre Béland pierz...@yahoo.fr: 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.59082031248); out meta; way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center qt; Pierre De : Stefan Keller sfkel...@gmail.com À : Talk Openstreetmap talk@openstreetmap.org Cc : Roland Olbricht roland.olbri...@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.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); ); out meta center qt; ; out meta center qt; ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk -- Christian Quest - OpenStreetMap France ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
On Thu, Jul 24, 2014 at 5:33 PM, Christian Quest cqu...@openstreetmap.fr wrote: In my last overpass test with the new out center feature, it looked like it was working only with XML output, not with the JSON (not GeoJSON) one. It's already reported: https://github.com/drolbr/Overpass-API/issues/93 Pieren ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
it is exact Christian. It did work with xml. But re-running with the json output option, the centroid is not added. Pierre De : Christian Quest cqu...@openstreetmap.fr À : Talk Openstreetmap talk@openstreetmap.org Envoyé le : Jeudi 24 juillet 2014 11h33 Objet : Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function? In my last overpass test with the new out center feature, it looked like it was working only with XML output, not with the JSON (not GeoJSON) one. 2014-07-24 16:30 GMT+02:00 Stefan Keller sfkel...@gmail.com: Thanks again - I think I got it - including a bug: GeoJSON is still returning polygons! But with XML it works. E.g. replacing [out:json] with [out:xml] or exporting as XML. --Stefan 2014-07-24 15:48 GMT+02:00 Pierre Béland pierz...@yahoo.fr: Stefan, In your example, the parenthesis are making a union of the two requests. and the greater then ( ) is doing a recurse request. This example below is working. It extract independantly nodes and ways, calculating the centroid for the ways. [out:json] [timeout:25] ; node[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta; way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center qt; Pierre De : Stefan Keller sfkel...@gmail.com À : Pierre Béland pierz...@yahoo.fr Cc : Talk Openstreetmap talk@openstreetmap.org Envoyé le : Jeudi 24 juillet 2014 9h44 Objet : Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function? Salut Pierre Thanks - But this doesn't parse (see below). I'm getting: Error: line 4: static error: Element print cannot be subelement of element union. -- Stefan [out:json] [timeout:25] ; ( node[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center; ); ; out meta qt; 2014-07-24 15:20 GMT+02:00 Pierre Béland pierz...@yahoo.fr: 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.59082031248); out meta; way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); out meta center qt; Pierre De : Stefan Keller sfkel...@gmail.com À : Talk Openstreetmap talk@openstreetmap.org Cc : Roland Olbricht roland.olbri...@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.59082031248); way[shop~dairy] (45.70234306798271,5.8831787109375,47.864773955792245,10.59082031248); ); out meta center qt; ; out meta center qt; ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk -- Christian Quest - OpenStreetMap France ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
Pieren wrote On Thu, Jul 24, 2014 at 5:33 PM, Christian Quest In my last overpass test with the new out center feature, it looked like it was working only with XML output, not with the JSON (not GeoJSON) one. It's already reported: https://github.com/drolbr/Overpass-API/issues/93 Pieren Right, some of the missing bits for JSON support are already implemented in the out_geom_json branch. However, Roland hasn't merged this branch into the master branch yet. https://github.com/drolbr/Overpass-API/tree/out_geom_json Best mmd -- View this message in context: http://gis.19327.n5.nabble.com/Overpass-API-Overpass-QL-center-and-centroid-function-tp5812491p5812549.html Sent from the General Discussion mailing list archive at Nabble.com. ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
Dear all Thanks for the help - especially from the french colleagues. I'm still struggling even with the XML output. My actual goal is to display the result set of the Dairy/Cheese Makers query in uMap. When I apply the query below to http://overpass-turbo.osm.ch/ the result is OK (displayed POIs: 386, Lines: 300, Polygons: 138). But when I add this URL as remote data to uMap, there are less markers displayed. It seems again that there is a problem with the ways/areas: http://umap.osm.ch/de/map/kasereien_18 You can easily see the difference when comparing to Simon's solution: Simon actually gave up using overpass within uMap and preprocessed the data locally: http://umap.osm.ch/de/map/kasereien_6 --Stefan [out:xml] [timeout:25] ; ( node[shop~dairy]; node [name~[Kk]äserei|[Cc]häsi|[Ff]romagerie|[Cc]aseificio|[Cc]hascharia]; node[produce~cheese]; node[craft~cheese_making]; ); out meta; ( way[shop~dairy]; way [name~[Kk]äserei|[Cc]häsi|[Ff]romagerie|[Cc]aseificio|[Cc]hascharia]; way[produce~cheese]; way[craft~cheese_making]; ); out meta center qt; ( ._; ; ); out meta qt; 2014-07-24 19:58 GMT+02:00 mmd mmd@gmail.com: Pieren wrote On Thu, Jul 24, 2014 at 5:33 PM, Christian Quest In my last overpass test with the new out center feature, it looked like it was working only with XML output, not with the JSON (not GeoJSON) one. It's already reported: https://github.com/drolbr/Overpass-API/issues/93 Pieren Right, some of the missing bits for JSON support are already implemented in the out_geom_json branch. However, Roland hasn't merged this branch into the master branch yet. https://github.com/drolbr/Overpass-API/tree/out_geom_json Best mmd -- View this message in context: http://gis.19327.n5.nabble.com/Overpass-API-Overpass-QL-center-and-centroid-function-tp5812491p5812549.html Sent from the General Discussion mailing list archive at Nabble.com. ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
Stefan Keller wrote I'm still struggling even with the XML output. My actual goal is to display the result set of the Dairy/Cheese Makers query in uMap. When I apply the query below to http://overpass-turbo.osm.ch/ the result is OK (displayed POIs: 386, Lines: 300, Polygons: 138). But when I add this URL as remote data to uMap, there are less markers displayed. It seems again that there is a problem with the ways/areas: I created a new issue for umap now [1], as I believe the center tag is not yet handled during import. Please feel free to enhance the ticket as needed. [1] https://bitbucket.org/yohanboniface/umap/issue/94/overpass-api-extension-center-in-osm -- View this message in context: http://gis.19327.n5.nabble.com/Overpass-API-Overpass-QL-center-and-centroid-function-tp5812491p5812559.html Sent from the General Discussion mailing list archive at Nabble.com. ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] Overpass API / Overpass QL: center (and centroid) function?
2014-07-24 21:39 GMT+02:00 mmd mmd@gmail.om mmd@gmail.com: I created a new issue for umap now [1], as I believe the center tag is not yet handled during import. Please feel free to enhance the ticket as needed. I'm almost sure it is not handled... but will be very soon as this overpass feature is really useful ! -- Christian Quest - OpenStreetMap France ___ talk mailing list talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/talk