Georeference details :: admin_level u.s.w.: formales Beispiel ...

Hallo und guten Tag,

ich hab einen interessanten Ansatz gefunden - für eine Overpass-Abfrage:

hier: https://gis.stackexchange.com/questions/237935/listing-churches-with-their-administrative-location-using-overpass

**Die Ausgangsfrage war **: … how to extract a list of churches from OSM with their name, their coordinates and the name of
the lower administrative division they belong to. I managed to get the first ones with:

**Antwort: ** I suggest to search for amenity=place_of_worship as well. There are 864226 of them (nodes and ways), while building=church only has 200886. For the admin division, you have to look into admin_level. It depends on your study area how deep they are detailed. –

btw: Similar to an example in the Overpass by Example library, I’d suggest to use the following query:

Church building ways in an area : When applying this technique to ways, one has to keep in mind that the is_in statement only works on nodes. For this reason, we first have to determine all nodes for a way.

try it in overpass-turbo

Vgl. hier: https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Adding_Georeference_details_to_village_nodes_.28since_0.7.54.29

**Step-by-step explanation how this query works: **

  • It iterates over each building=church in your area
  • determines all nodes for each building
  • find out in which areas those nodes are (this is the actual georeferencing step)
  • filter out all areas with boundary=administrative and admin_level between 2 and 8 (you can adjust those if needed).
  • print out the center point of the church building way generates an artificial element with the same way id and an additional element is_in, which lists all administrative boundaries the church is in.
  • prints out artificial element
  • Note that the query returns two ways for each church, one with a center node, and one with an is_in entry but without geometry. At this time, you have to manually merge those two ways. In a later version of Overpass API this will change, though, returning only one single result including geometry.

The line containing georeferencing information looks as follows:

results: in csv gist:10e867cfcfbe15fcef65867e64b6630e · GitHub

Das sieht alles sehr sehr interessant aus - und vielversprechend. Aber diese drei Zeilen hier, die verstehe ich nicht richtig.

Ich habe Schwierigkeiten hier konkrete Daten & Werte einzusetzen. Kann hier jemand ggf. aushelfen mit einem konkreten Beispile.l

vgl. auch hier: https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Adding_Georeference_details_to_village_nodes_.28since_0.7.54.29


  1. 2-8 ↩︎

Hallo,
weiß jetzt nicht genau was du willst oder wo dein Problem drin besteht, was für Daten/Werte meinst du denn?

Ein Punkt ist halt, bei:

Fehlen um admin_level und name halt die “” … das gibt overpass-Turbo aber auch aus als Fehlermeldung.

Funktionierendes Beispiel:
https://overpass-turbo.eu/s/17gs

Habe da ein paar Änderungen noch vorgenommen:

  1. Ort zu Kiel
  2. nicht nur bei erster Way-Abfrage (Zeile 5) den Suchbereich als Kriterium genommen, sondern auch noch Zeile 12
  3. In Zeile 7 gesagt, dass ich nur einen Node (den ersten) je Way haben möchte.
  4. beide Male “out geom”

Warum?

  1. Einfach so
    2 & 3 - ich bilde mir ein, dass damit weniger abgefragt wird, was eh rausfällt und es somit performanter ist
  2. somit hat man das neue Attribut “is_in” auch bei einem Klick auf das Ergebnis in overpass-turbo mit drin. Sonst hat man es nur in den Daten.

Ja, leider hat sich die Syntax von t[ ] zwischenzeitlich geändert und die Variante ohne Anführungszeichen wird inzwischen nicht mehr akzeptiert. Ich habe meine Antwort mal auf den aktuellen Stand gebracht.

Die Variante für Punkt 3 gab es 2017 auch noch nicht…

Hallo und guten Abend the asca u. mmd,

vielen Dank für die rasche Antwort und die Erläuterungen. Das ist alles sehr sehr hilfreich. Danke auch für das Beispiel.
Ich hatte mit der Syntax ( auch auf der o.g. Wiki-page ) doch etwas Schwierigkeiten.

By the way: das Ganze auch in CSV auszugeben sollte m.E. auch möglich sein. [ https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Adding_Georeference_details_to_village_nodes_.28since_0.7.54.29 ] ff.

ich guck nochmals nach - Euch jedenfalls vielen Dank!!

Viele Grüße TagTheWorld :slight_smile:

Joa ähm, bitte: https://overpass-turbo.eu/s/17hh

hallo asca,

vielen Dank!

Grüße
TagTheWorld:)

Übrigens werden Area in Area Suchen definitiv nicht unterstützt, d.h. der Filter auf (area.search) ist an der Stelle völlig wirkungslos. Es kann sein, dass in späteren Versionen dafür auch eine Fehlermeldung erzeugt wird.

Das hat performancemäßig keine signifikante Auswirkung. Die Unterschiede liegen im Grundrauschen im Bereich <0,1s, bei einer Laufzeit von 2,5s.