1

I would like to request all service companies in specified area using the Overpass API.

The following request delivers only the result of the first filter node[shop](area); and does not unify with the second filter for restaurants and bars.

area[name="Kriens"];
(
node[shop](area);
node["amenity"~"^(restaurant|bar|fast_food|cafe)$"](area);
);  
out center;

I try to accomplish a Union of filters as described in the documentation. What's wrong with the given filter?

By-the-way: What filter-set would you recommend retrieving all publically accessible commercial services (shops, bars, restaurant etc. but not schools, libraries etc.)?

0

1 Answer 1

3

You need to store the result of your area() call in a named set first. Without a named set, the results are stored in the default set. This default set gets overwritten by your node[shop](area); query.

As a solution, store the result in a named set. Then perform your queries on this named set:

area[name="Kriens"]->.foo;
(
    node[shop](area.foo);
    node["amenity"~"^(restaurant|bar|fast_food|cafe)$"](area.foo);
);  
out center;

I'm not an expert on Overpass API. I hope my explanations are correct.

1

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