使用Overpass API在坐标周围查找多个标签 [英] Find multiple tags around coordinates with Overpass API

查看:146
本文介绍了使用Overpass API在坐标周围查找多个标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出此立交查询 https://overpass-turbo.eu/s/Sle ,即搜索博物馆和美术馆,我如何引入一种新型标签来在同一位置进行搜索,例如我还想在同一区域(lat: 500,53.866444lon: 10.684738周围500米)内搜索node["amenity"~"cafe|bar"] .我尝试过的所有操作都会引发错误或返回不完整的结果,例如,以下作品,但仅返回咖啡馆和酒吧,而没有博物馆.

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;

推荐答案

您需要组合两个结果集:

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;

请参见 https://overpass-turbo.eu/s/Ss6 .

或者尝试在Overpass-turbo上使用向导,例如通过搜索tourism~"museum|gallery" or amenity~"cafe|bar".

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).

这篇关于使用Overpass API在坐标周围查找多个标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆