共用方式為


geo_geohash_to_central_point()

適用於:✅Microsoft網狀架構Azure 數據✅總管 Azure 監視器✅Microsoft Sentinel

計算地理空間座標,代表地理hash 矩形區域的中心。

深入瞭解 geohash

語法

geo_geohash_to_central_point(geohash)

深入瞭解 語法慣例

參數

姓名 類型​​ 必要 描述
geohash string ✔️ 以geo_point_to_geohash()計算的地理hash 值。 地理hash 字串必須介於1到18個字元之間。

傳回

GeoJSON 格式和動態數據類型的地理空間座標值。 如果 geohash 無效,查詢將會產生 Null 結果。

注意

GeoJSON 格式會指定經度第一個和緯度第二。

範例

print point = geo_geohash_to_central_point("sunny")
| extend coordinates = point.coordinates
| extend longitude = coordinates[0], latitude = coordinates[1]

輸出

point 座標 經度 緯度
{
"type": "Point",
“coordinates”: [
42.47314453125,
23.70849609375
]
}
[
42.47314453125,
23.70849609375
]
42.47314453125 23.70849609375

下列範例會傳回 Null 結果,因為地理hash 輸入無效。

print geohash = geo_geohash_to_central_point("a")

輸出

geohash

您可以使用 geohash 值來建立 Bing 地圖服務的深層連結 URL,方法是指向 geohash 中心點:

// Use string concatenation to create Bing Map deep-link URL from a geo-point
let point_to_map_url = (_point:dynamic, _title:string) 
{
    strcat('https://www.bing.com/maps?sp=point.', _point.coordinates[1] ,'_', _point.coordinates[0], '_', url_encode(_title)) 
};
// Convert geohash to center point, and then use 'point_to_map_url' to create Bing Map deep-link
let geohash_to_map_url = (_geohash:string, _title:string)
{
    point_to_map_url(geo_geohash_to_central_point(_geohash), _title)
};
print geohash = 'sv8wzvy7'
| extend url = geohash_to_map_url(geohash, "You are here")

輸出

geohash URL
sv8wzvy7 https://www.bing.com/maps?sp=point.32.15620994567871_34.80245590209961_You+are+here