【问题标题】:Overpass QL: Possibility to set "around" globally like bounding box (bbox)Overpass QL:可以像边界框(bbox)一样全局设置“周围”
【发布时间】:2020-02-18 10:25:33
【问题描述】:

我正在尝试使用 Overpass Api 通过 Get 从 OpenStreetMap 获取有关我当前位置的信息。 使用边界框就可以了:

https://overpass-api.de/api/interpreter?data=[timeout:25][out:json];(way[%22amenity%22=%22hospital%22][%22emergency%22=%22yes%22](bbox);relation[%22amenity%22=%22hospital%22][%22emergency%22=%22yes%22](bbox);way[%22amenity%22=%22fire_station%22](bbox);relation[%22amenity%22=%22fire_station%22](bbox););out%20geom;&bbox=westlimit,southlimit,eastlimit,northlimit

现在我的问题是我只知道当前坐标(纬度、经度)。我想在这个坐标周围查询大约 10'000m。

我知道周围有。这将是该查询的 QL:

[out:json][timeout:25];
(
  way["amenity"="hospital"]["emergency"="yes"](around:10000,latitude,longitude);
  relation["amenity"="hospital"]["emergency"="yes"](around:10000,latitude,longitude);
 way["amenity"="fire_station"](around:10000,latitude,longitude);
  relation["amenity"="fire_station"](around:10000,latitude,longitude);
);
// print results
out geom;

我想使用 API 的 GET Endpoint 如您所见,around 参数正在重复。

可以像上面的bbox那样全局设置吗?

【问题讨论】:

    标签: openstreetmap overpass-api


    【解决方案1】:

    不,这是不可能的,你不能在全局层面上定义“周围”。

    有一个增强请求,通过使用一个“wr”而不是一个“方式”和另一个“关系”查询来稍微缩短查询。在撰写本文时,这还不可用。

    更多详情请见https://github.com/drolbr/Overpass-API/issues/535

    【讨论】:

      猜你喜欢
      • 2017-06-03
      • 2017-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-16
      • 2021-12-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多