You are not logged in.

Announcement

*** NOTICE: forum.openstreetmap.org is being retired. Please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators.
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***

#1 2021-11-06 07:50:58

Heinz_V
Member
Registered: 2009-02-23
Posts: 231

Query: lat/lon des Zentrums von Polygonen und Relationen?

Ich habe mal wieder eine Frage zu Overpass Turbo queries.
Wie kann ich in einer CSV-Ausgabe die lat/lon-Werte vom Mittelpunkt (oder so) der Polygone und Relationen ausgeben?
http://overpass-turbo.eu/s/1cL8

Meine intensive Suche nach einer Lösung war erfolglos.

Offline

#2 2021-11-06 09:09:37

mmd
Member
Registered: 2010-11-06
Posts: 2,150

Re: Query: lat/lon des Zentrums von Polygonen und Relationen?

https://dev.overpass-api.de/misc/fossgi … rkshop.pdf

Auf der Folie 18 „Daten exportieren“ unten links ist ein Beispiel mit center und csv.

Tabellenkalkulation:
[out:csv(::lat,::lon,name)];
way[shop=bakery]({{bbox}});
out center;

Last edited by mmd (2021-11-06 09:10:38)

Offline

#3 2021-11-06 12:33:36

Heinz_V
Member
Registered: 2009-02-23
Posts: 231

Re: Query: lat/lon des Zentrums von Polygonen und Relationen?

Danke das klappt.

Ich hatte gefunden "This adds only the center of the above mentioned bounding box to ways and relations. "
Daher nahm ich an, dass stets nur das Zentrum der bounding box ausgegeben wird.

Offline

#4 2021-11-06 13:28:22

mmd
Member
Registered: 2010-11-06
Posts: 2,150

Re: Query: lat/lon des Zentrums von Polygonen und Relationen?

Richtig, out center gibt den Mittelpunkt der Bounding Box aus: https://overpass-turbo.eu/s/1cLm
Für kleine Objekte reicht das oft aus. Allerdings liegt der Mittelpunkt nicht notwendigerweise im Objekt selbst (Stichwort "U"-förmiges Gebäude).

Offline

#5 2021-11-06 14:41:11

Heinz_V
Member
Registered: 2009-02-23
Posts: 231

Re: Query: lat/lon des Zentrums von Polygonen und Relationen?

OK; gemeint ist die bbox der einzelnen Ojekte.
Nicht die bbox des gesamten Abfragebereichs; das wäre bei mir Punjab und ist ohne Wert.

Offline

Board footer

Powered by FluxBB