Can we create a query that shows up all the schools that are near - in other words - (it is a anra search) how to perform a search

hello

this question is one of a Neaby-search:

can we create a quewry that shows up all the schools that are in the near - in other words - (it is a area search) how to perform a search - for http://www.overpass-turbo.eu :

example: what i am after. how to create a request to find all the schools - in the area of - let us say munich - in a radius of 10 km for example!?

how can we find all the schools around a certain point - or in other words; all in Munich - in a area /(radius) of let us say 10 kilometers can we create a query that works on Overpass-turbo.eu

approach: well, as far i know: OpenStreetMap data consists of three basic elements: nodes, ways and relations.
A generall query searches for (only) for nodes. Some schools will be mapped as ways and a few others as relations. we have to change your query in order to search for all three elements:

area[name = "Council of the City of Ryde"];
(
node(area)[amenity = school];
way(area)[amenity = school];
relation(area)[amenity = school];
);
out;

Alternatively we just use the keyword nwr to search for all three elements:


area[name = "Council of the City of Ryde"];
nwr(area)[amenity = school];
out;

but what i am after. how to create a request to find all the schools - in the area of - let us say munich - in a radius of 10 km for example!?

well could this be an approach to solve the problem!?


[out:json];
// Define the area of Munich
area[name="Munich"]->.searchArea;
// Search for schools within a 10-kilometer radius of Munich
(
  node(around.searchArea:10000)["amenity"="school"];
  way(around.searchArea:10000)["amenity"="school"];
  relation(around.searchArea:10000)["amenity"="school"];
);
// Output the results
out body;
>;
out skel qt;

7 posts - 3 participants

Read full topic


Ce sujet de discussion accompagne la publication sur https://community.openstreetmap.org/t/can-we-create-a-query-that-shows-up-all-the-schools-that-are-near-in-other-words-it-is-a-anra-search-how-to-perform-a-search/109344