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

What is a correct overpass-turbo query for getting all streets in a city?

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

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

然而 returns

{
  "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:highway=street

这个tag come from? street is not a valid value for the highway key在哪里。事实上,由于您想要获得 all 街道,您必须完全省略该值并仅查询 highway.

错误2:节点()

道路不是node but a way。所以你必须改为查询 way(area)[...] 。这也需要一个递归步骤(>;)来检索这些方式的所有节点。

更正查询

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