geo_geohash_to_central_point()

Vypočítá geoprostorové souřadnice, které představují střed obdélníkové oblasti geohash.

Přečtěte si další informace o geohash.

Syntax

geo_geohash_to_central_point(geohash)

Přečtěte si další informace o konvencích syntaxe.

Parametry

Název Typ Vyžadováno Popis
geohash string ✔️ Hodnota geohash vypočítaná pomocí geo_point_to_geohash(). Řetězec geohash musí mít 1 až 18 znaků.

Návraty

Geoprostorové hodnoty souřadnic ve formátu GeoJSON a dynamického datového typu. Pokud je geohash neplatný, dotaz vygeneruje výsledek null.

Poznámka

Formát GeoJSON určuje zeměpisnou délku první a druhou zeměpisnou šířku.

Příklady

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

Výstup

Bod souřadnice Délky zeměpisná šířka
{
"type": "Point",
"souřadnice": [
42.47314453125,
23.70849609375
]
}
[
42.47314453125,
23.70849609375
]
42.47314453125 23.70849609375

Následující příklad vrátí výsledek null z důvodu neplatného vstupu geohash.

print geohash = geo_geohash_to_central_point("a")

Výstup

geohash

Hodnotu geohash můžete použít k vytvoření adresy URL s přímým odkazem pro Mapy Bing tak, že přejdete na centrální bod 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")

Výstup

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