问题
Given this overpass query https://overpass-turbo.eu/s/Sle, that searches for museums and galleries, how can I introduce a new type of tag to search around the same location, for example I want to also search for node["amenity"~"cafe|bar"]
around the same area (500 meters around lat: 500,53.866444
and lon: 10.684738
. Everything I've tried either raises an error or returns incomplete results. For example, the following works, but only returns cafés and bars but no museums.
[out:json];
node["tourism"~"museum|gallery"](around:500,53.866444, 10.684738);
node["amenity"~"cafe|bar"](around:500,53.866444, 10.684738);
out center;
回答1:
You need to combine both result sets:
[out:json];
(
node["tourism"~"museum|gallery"](around:500,53.866444, 10.684738);
node["amenity"~"cafe|bar"](around:500,53.866444, 10.684738);
);
out center;
See https://overpass-turbo.eu/s/Ss6.
Alternatively try using the wizard at overpass-turbo, for example by searching for tourism~"museum|gallery" or amenity~"cafe|bar"
.
Also note that you are just searching for nodes. You will miss POIs mapped as ways or relations (the latter occurs rarely, though). So either add additional queries for ways and relations or replace node
with nwr
(node way relation).
来源:https://stackoverflow.com/questions/61025327/find-multiple-tags-around-coordinates-with-overpass-api