I am trying to understand the concepts of queries on overpass-turbo.
In this query I wanted to find all churches of cologne and have started with a query on nodes of buildings. The result had only few results. So, I added a query on areas, but got only timeouts and big datasets, but no results on the map. After more and more restrictions, I noticed, the filter has no effect on the dataset (result contained churches from Karsruhe).
So I started to wonder if I can control, when the filter gets effect, on the database level or on the json result and effects only on the presentation layer.
So my questions are:
Why do I get over 100MB on data, but see no results on the map?
Am I able to control the query to filter first on the location AND dataset (amenity=place_of_worship) and retrieve only a small json result, to display then?
This probably isn’t what you want. “Areas” are artificially-created Overpass API objects that are derived from the OSM database. If what you want is every church, you’ll need to search for nodes, ways, and relations to get the actual OSM objects. You can modify your query to add each of these, or you could simply use the Overpass Turbo wizard to create the query using something like:
amenity=place_of_worship and protect_class!=* in "Cologne"
Overpass API doesn’t use any geocoder, you have to specify tag keys and values as they occur in the OSM data. Instead of name=“Cologne” you would have to use name=“Köln”, i.e. the name in German.
{{geocodeArea:Cologne}} is an overpass turbo extension, which is unknown to Overpass API. It’s an instruction to do a Nominatim lookup for “Cologne” before sending the query to Overpass API. Behind the scenes, it will eventually send the following query to Overpass API:
[out:json][timeout:25];
area(3600062578)->.searchArea;
(
// query part for: “"place of worship"”
node["amenity"="place_of_worship"](area.searchArea);
way["amenity"="place_of_worship"](area.searchArea);
relation["amenity"="place_of_worship"](area.searchArea);
);
out body;
>;
out skel qt;