你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

geo_geohash_to_central_point()

Applies to: ✅ Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

Calculates the geospatial coordinates that represent the center of a geohash rectangular area.

Read more about geohash.

Syntax

geo_geohash_to_central_point(geohash)

Learn more about syntax conventions.

Parameters

Name Type Required Description
geohash string ✔️ A geohash value as it was calculated by geo_point_to_geohash(). The geohash string must be between 1 and 18 characters.

Returns

The geospatial coordinate values in GeoJSON Format and of a dynamic data type. If the geohash is invalid, the query will produce a null result.

Note

The GeoJSON format specifies longitude first and latitude second.

Examples

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

Output

point coordinates longitude latitude
{
"type": "Point",
"coordinates": [
42.47314453125,
23.70849609375
]
}
[
42.47314453125,
23.70849609375
]
42.47314453125 23.70849609375

The following example returns a null result because of the invalid geohash input.

print geohash = geo_geohash_to_central_point("a")

Output

geohash

You can use the geohash value to create a deep-link URL to Bing Maps by pointing to the geohash center point:

// 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")

Output

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