There are different ways to define search areas using Overpass API.

For example:

Geocode area




out body;
out skel qt;

Area query returning unique result




out body;
out skel qt;

Find more details here in the Overpass API documentation.

But what if I want to define a set of areas that I want to use in an iteration afterwards (e.g. a set of selected large cities)? Is there a way to create something like an "array of areas" to be used for the following tag queries?

1 Answer 1


To filter by multiple areas, the union statement can be used.

Here's an example that shows the number of hotels within the largest German cities based on OpenStreetMap data (with the foreach part inspired by this GIS SE answer):

[out:csv(city, hotels)];
  make count city = c.set(t["name"]),
             hotels = count(nodes) + count(ways) + count(relations);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.