Find multiple tags around coordinates with Overpass API

冷暖自知 提交于 2020-04-16 05:47:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!