gpt4 book ai didi

openstreetmap - 获取城市中所有街道的正确立交桥涡轮查询是什么?

转载 作者:行者123 更新时间:2023-12-02 03:06:46 25 4
gpt4 key购买 nike

我想使用 http://overpass-turbo.eu/ 获取纽约市的所有街道。我试过这个:

[out:json]; area[name = "New York"]; (node(area)[highway=street]; ); out;

但是它返回

{
"version": 0.6,
"generator": "Overpass API 0.7.55.1009 5e627b63",
"osm3s": {
"timestamp_osm_base": "2019-11-13T19:26:03Z",
"timestamp_areas_base": "2019-11-13T18:05:02Z",
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
},
"elements": [



]
}

没有元素。然而这个查询:

[out:json]; area[name = "New York"]; ( node(area)[amenity=cinema]; node(area)[highway=street]; ); out;

获取街道电影院,有效:

{
"version": 0.6,
"generator": "Overpass API 0.7.55.1009 5e627b63",
"osm3s": {
"timestamp_osm_base": "2019-11-13T19:29:02Z",
"timestamp_areas_base": "2019-11-13T18:05:02Z",
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
},
"elements": [

{
"type": "node",
"id": 344994897,
"lat": 41.7680892,
"lon": -73.9291000,
"tags": {
"amenity": "cinema",
"created_by": "Potlatch 0.10f",
"name": "Roosevelt Theater"
}
},
...

我应该如何修改初始查询来获取街道?

最佳答案

您的查询中有两个错误。

错误1:高速公路=街道

这是在哪里tag来自? street 不是 highway key 的有效值。事实上,由于您想要获取所有街道,因此您必须完全省略该值,只查询highway

错误2:节点()

道路不是node但是一个way 。因此,您必须查询 way(area)[...] 。这还需要一个向上递归步骤(>;)来检索这些路径的所有节点。

更正查询

[out:json]; area[name = "New York"]; (way(area)[highway]; ); (._;>;); out;

关于openstreetmap - 获取城市中所有街道的正确立交桥涡轮查询是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58844414/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com