Wie kann ich eine Overpass-Abfrage für mehrere ausgewählte Bundesländer vornehmen?

Ich möchte in Vorbereitung einer MapRoulette Challange eine Abfrage über mehrere ausgewählte Bundesländer durchführen - wie muss ich die Abfrage für die searchArea gestalten?

Danke für die Hilfe

Hei,

bei meinen Knotenpunktnetzabfragen mache ich es so:

(
{{geocodeArea:"Elbe-Elster"}}; 
{{geocodeArea:"Oberspreewald-Lausitz"}};
{{geocodeArea:"Spree-Neiße"}}; 
{{geocodeArea:"Dahme-Spreewald"}};
{{geocodeArea:"Cottbus"}};  
)->.boundaryarea;

Beispiel:

Sven

3 Likes

Danke, funktioniert (ich lerne)

1 Like

Mist, mit overpass funktioniert, aber die gleiche overpass-abfrage in MapRoulette gibt Fehlermeldungen:

<p><strong style="color:#FF0000">Error</strong>: line 3: parse error: Unknown type &quot;{&quot; </p>
<p><strong style="color:#FF0000">Error</strong>: line 3: parse error: An empty query is not allowed </p>
<p><strong style="color:#FF0000">Error</strong>: line 3: parse error: ';' expected - '{' found. </p>
<p><strong style="color:#FF0000">Error</strong>: line 4: parse error: Unknown type &quot;{&quot; </p>
<p><strong style="color:#FF0000">Error</strong>: line 4: parse error: An empty query is not allowed </p>
<p><strong style="color:#FF0000">Error</strong>: line 4: parse error: ';' expected - '{' found. </p>
<p><strong style="color:#FF0000">Error</strong>: line 5: parse error: Unknown type &quot;{&quot; </p>
<p><strong style="color:#FF0000">Error</strong>: line 5: parse error: An empty query is not allowed </p>
<p><strong style="color:#FF0000">Error</strong>: line 5: parse error: ';' expected - '{' found. </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: Unknown type &quot;{&quot; </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: An empty query is not allowed </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: ';' expected - '{' found. </p>

Wo kommt das color her?

…du wirst nach meinem Beispiellink alles, was ab {{style:… ist, rausschmeiem müssen…
Alles, was im Bereich {{style:…} steht ist nur gaphische Gestaltung…

Sven

1 Like

Ich habs gar ned aus Deinem Beispiel und gar ned die style kopiert.

genau diese Abfrage in MapRoulette kopiert (vorsorglich als unformatierter Text)
und erhalte (komplett):

Bad Request:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" lang="en"/>
  <title>OSM3S Response</title>
</head>
<body>

<p>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</p>
<p><strong style="color:#FF0000">Error</strong>: line 3: parse error: Unknown type &quot;{&quot; </p>
<p><strong style="color:#FF0000">Error</strong>: line 3: parse error: An empty query is not allowed </p>
<p><strong style="color:#FF0000">Error</strong>: line 3: parse error: ';' expected - '{' found. </p>
<p><strong style="color:#FF0000">Error</strong>: line 4: parse error: Unknown type &quot;{&quot; </p>
<p><strong style="color:#FF0000">Error</strong>: line 4: parse error: An empty query is not allowed </p>
<p><strong style="color:#FF0000">Error</strong>: line 4: parse error: ';' expected - '{' found. </p>
<p><strong style="color:#FF0000">Error</strong>: line 5: parse error: Unknown type &quot;{&quot; </p>
<p><strong style="color:#FF0000">Error</strong>: line 5: parse error: An empty query is not allowed </p>
<p><strong style="color:#FF0000">Error</strong>: line 5: parse error: ';' expected - '{' found. </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: Unknown type &quot;{&quot; </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: An empty query is not allowed </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: ';' expected - '{' found. </p>

</body>
</html>

Irgendwas mach MapRoulette anders

Dann probier es mal wie folgt:

[out:json][timeout:25];
(
  area[name="Saarland"];
  area[name="Rheinland-Pfalz"];
)->.a;

// key and value sind nur Beispiele :D
nwr["key"="value"](area.a);
out geom;

Hab’ ich von User:Binnette/OverpassQueries - OpenStreetMap Wiki

Umweg über Export GeoJson und Import in MapRoulette bringt das gleiche Ergebnis

Abgesehen davon, dass ich einmal Hamburg in USA mit erwische - funktioniert in MapRoulette

Schon mal einen Schritt weiter:

Bundesländer kannst Du auch über den Regionalschlüssel bekommen, siehe

https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Count_Pharmacies_per_County_(updated_0.7.54)

und

https://wiki.openstreetmap.org/wiki/DE:Key:de:regionalschluessel

1 Like

Sowas wie

{{geocodeArea:"Elbe-Elster"}}; 

ist eine Spezialfunktion von Overpass Turbo. Turbo geocodiert den Begriff und sendet an Overpass dann nur noch eine numerische Flächen-ID. Wenn Du sicher sein willst, dass Du keine unerwünschten Flächen (in den USA usw.) bekommst, kannst Du die Area-IDs auch selber von Hand festlegen. Details sind auf Filter by area

1 Like

Wie schon geschrieben hilft mir das nicht weiter, da MapRoulette das irgendwie nicht verarbeitet.

Dank dieses Links habeich aber eine bequemere Methode gefunden, Orte/Gebiete gleichen Namens (Berlin,Hamburg, Bremen) außerhalb Deutschlands auszuschließen:

area[name="London"]->.small;
area[name="England"]->.big;
nwr[shop=supermarket](area.small)(area.big);
out center;