1

I have the following overpass turbo query:

[out:json];
area[name="Zagreb"];
(
  node["tourism"~"museum|gallery"](area);
  node["amenity"~"cafe|bar"](area);
);
out center;

You can run it here: https://overpass-turbo.eu/s/1hmp

The problem is that it only returns the first node, so the tourism="museum|gallery" in this case, but not the amenity="cafe|bar".

I based my query on this answer, where both nodes get returned(!!!): Find multiple tags around coordinates with Overpass API

[out:json];
(
  node["tourism"~"museum|gallery"](around:500,53.866444, 10.684738);
  node["amenity"~"cafe|bar"](around:500,53.866444, 10.684738);
);
out center;

You can run this original one here: https://overpass-turbo.eu/s/1hml

Except that I changed the 'around' to the area of name="Zagreb". And this clearly works (although just for one of the nodes).

Does anyone have any ideas how to get both nodes (tourism="museum|gallery" and amenity="cafe|bar") to work within an area?

Thanks so much! Lovro

1 Answer 1

1

You need to store the area in a named inputset (below it's named ".myarea"), otherwise the result of the first node statement would overwrite the area in the default inputset (called ._), and would no longer be available for the second node query.

[out:json];
area[name="Zagreb"]->.myarea;
(
  node["tourism"~"museum|gallery"](area.myarea);
  node["amenity"~"cafe|bar"](area.myarea);
);
out center;

Quite a frequent issue by the way, and I'm sure there are several other post that already deal with this error.

1
  • Huh, interesting. I never would have thought about something like this, and unfortunately I didn't stumble upon it in my research. Thanks so much for your time and effort, I appreciate it! :) Commented Apr 18, 2022 at 12:26

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.