
[英]is there any relationship between zoom level and latitude longitude in OVERPASS API?
[英]get latitude and longitude from node id in overpass API
我使用此查詢從立交橋API中的節點ID獲取緯度和經度:
[out:json]; (
node(2314028892);
node(30223035);
node(268195434);
node(30223039);
); (._;>;); out;
我得到這個答案:
{
"version": 0.6,
"generator": "Overpass API 0.7.55.3 9da5e7ae",
"osm3s": {
"timestamp_osm_base": "2018-06-28T07:47:01Z",
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
},
"elements": [
{
"type": "node",
"id": 30223035,
"lat": 52.2917680,
"lon": 10.5265481
},
{
"type": "node",
"id": 30223039,
"lat": 52.2894248,
"lon": 10.5268394
},
{
"type": "node",
"id": 268195434,
"lat": 52.2897618,
"lon": 10.5267852
},
{
"type": "node",
"id": 2314028892,
"lat": 52.2919739,
"lon": 10.5265271,
"tags": {
"bus": "yes",
"name": "Rühmer Weg",
"network": "VRB",
"operator": "Braunschweiger Verkehrs-GmbH",
"public_transport": "stop_position",
"ref": "464"
}
}
]
}
答案中的元素似乎具有另一種順序。 現在,我想以與查詢中相同的順序獲得答案。 (首先是節點2314028892,然后是30223035,...)
有人知道我該怎么做嗎?
在每個查詢語句后使用“ out”:
[out:json];
node(2314028892);out
node(30223035);out
node(268195434);out;
node(30223039);out;
出於性能原因,我建議您將此操作作為后期處理步驟。 您已經知道正確的順序,因此可以輕松地將其應用於查詢結果。 另外,您可以在單個查詢中指定多個節點ID值:
[out:json]; node(id:2314028892, 30223035, 268195434, 30223039);out;
旁注:您也可以省略(._;>;);
在您的查詢中。 如果是節點,則不需要。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.