openstreetmap - 如何在 Overpass QL 上获取与具有特定值的多个标签匹配的节点

标签 openstreetmap overpass-api

我正在尝试从 Overpass API 获取与 tourism=museum 或 historical=memorial 匹配的 POI。 我尝试了不同的查询,但找不到正确的解决方案,我得到的响应是空的。

这里不是工作查询

area["name"="Bursa"];                                                                     
(node["tourism"="museum"](area);); 
(node["historic"="memorial"](area););
out center;
area["name"="Bursa"];                                                               
(node["tourism"="museum"]|["historic"="memorial"](area);); 
out center;

我在 OverpassTurbo 上尝试了这些查询

谢谢,艾尔辛。

最佳答案

在同一区域(也只是一个集合)上执行多个查询时,您必须使用命名集合。否则第二次查询将根据第一次查询的结果执行。

area["name"="Bursa"]->.a;
(
  node["tourism"="museum"](area.a);
  node["historic"="memorial"](area.a);
);
out center;

另请注意,您只是在查询 nodes ,因此您的查询不会找到任何添加为 way 的博物馆或纪念馆。或 relation .以下查询也将包括那些:

area["name"="Bursa"]->.a;
(
  nwr["tourism"="museum"](area.a);
  nwr["historic"="memorial"](area.a);
);
out center;

关于openstreetmap - 如何在 Overpass QL 上获取与具有特定值的多个标签匹配的节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59070799/

相关文章:

java - Overpasser 库使用

javascript - 是否可以使用不同投影的另一个 WMS 图层显示 OSM 数据?

openstreetmap - 按点查找建筑物

json - 使用管道 Node 请求防止立交桥 api 上的 504 网关超时

comparison-operators - Overpass-api 比较运算符

leaflet - 仅返回 Leaflet 中选定的 GeoJSON 元素

python - 如何使用 Python 和 OSM 获取我附近的列表?

python - 如何使用 python 以 XML 格式保存 OSM 文件,其结构与从 OpenStreetMap 网站导出的 .osm 文件相同?

javascript - 多条折线路线上的 Leaflet Loop Snake 功能

openstreetmap - 查询立交桥 API 查询有过桥/铁路的道路