geo_geohash_neighbors()
Vypočítá sousedy Geohash.
Přečtěte si další informace o geohash
.
Syntax
geo_geohash_neighbors(
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
Pole sousedů Geohash. Pokud je geohash neplatný, dotaz vytvoří výsledek null.
Příklady
Následující příklad vypočítá sousedy Geohash.
print neighbors = geo_geohash_neighbors('sunny')
Výstup
Sousedy |
---|
["sunnt","sunpj","sunnx","sunpn","sunnv","sunpp","sunnz","sunnw"] |
Následující příklad vypočítá pole vstupní geohash se svými sousedy.
let geohash = 'sunny';
print cells = array_concat(pack_array(geohash), geo_geohash_neighbors(geohash))
Výstup
Buňky |
---|
["sunny","sunnt","sunpj","sunnx","sunpn","sunnv","sunpp","sunnz","sunnw"] |
Následující příklad vypočítá kolekci geometrie GeoJSON geohash polygonů.
let geohash = 'sunny';
print cells = array_concat(pack_array(geohash), geo_geohash_neighbors(geohash))
| mv-expand cells to typeof(string)
| project polygons = geo_geohash_to_polygon(cells)
| summarize arr = make_list(polygons)
| project geojson = bag_pack("type", "Feature","geometry", bag_pack("type", "GeometryCollection", "geometries", arr), "properties", bag_pack("name", "polygons"))
Výstup
geojson |
---|
{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [ {"type":"Mnohoúhelník","souřadnice":[[[42.451171875,23.6865234375],[42.4951171875,23.6865234375],[42,4951171875,23.73046875],[42.451171875,23.73046875],[42.451171875,23.6865234375]]]}, {"type":"Mnohoúhelník","souřadnice":[[42.4072265625,23,642578125],[42,451171875,23,642578125],[42,45117 1875,23,6865234375],[42.4072265625,23,6865234375],[42.4072265625,23.642578125]]]}, {"type":"Mnohoúhelník","souřadnice":[[[42.4072265625,23,73046875],[42,451171875,23,73046875],[42,451171875,23.7744140625],[42.4072265625,23.7744140625],[42.4072265625,23.73046875]]]}, {"type":"Mnohoúhelník","souřadnice":[[42.4951171875,23,642578125],[42,5390625,23,642578125],[42,53906 25,23.6865234375],[42.4951171875,23.6865234375],[42.4951171875,23.642578125]]]}, {"type":"Mnohoúhelník","souřadnice":[[[42,451171875,23,73046875],[42,4951171875,23,73046875],[42,4951171875,23,7744140625],[42.451171875,23.7744140625],[42.451171875,23.73046875]]]}, {"type":"Polygon","souřadnice":[[[42.4072265625,23.6865234375],[42.451171875,23.6865234375],[42,451 171875,23,73046875],[42.4072265625,23,73046875],[42.4072265625,23.6865234375]]]}, {"type":"Mnohoúhelník","souřadnice":[[42.4951171875,23,73046875],[42,5390625,23,73046875],[42,5390625,23.7744140625],[42.4951171875,23.7744140625],[42.4951171875,23.73046875]]]}, {"type":"Mnohoúhelník","souřadnice":[[[42,4951171875,23,6865234375],[42,5390625,23,6865234375],[42,5390625,23,73046875],[42.4951171875,23.73046875],[42.4951171875,23.6865234375]]]}, {"type":"Mnohoúhelník","souřadnice":[[42.451171875,23.642578125],[42.4951171875,23.642578125],[42.495117 1875,23,6865234375],[42.451171875,23.6865234375],[42.451171875,23.642578125]]]}]}, "properties": {"name": "polygons"}} |
Následující příklad vypočítá mnohoúhelníky sjednocení, které představují Geohash a jeho sousedy.
let h3cell = 'sunny';
print cells = array_concat(pack_array(h3cell), geo_geohash_neighbors(h3cell))
| mv-expand cells to typeof(string)
| project polygons = geo_geohash_to_polygon(cells)
| summarize arr = make_list(polygons)
| project polygon = geo_union_polygons_array(arr)
Výstup
Mnohoúhelník |
---|
{"type":"Polygon","coordinates":[[[42.4072265625,23.642578125],[42.451171875,23.642578125],[42.4951171875,23.642578125],[42.5390625,23.642578125],[42.5390625,23.686523437500004],[42.5390625,23.730468750000004],[42.5390625,23.7744140625],[42.4951171875,23.7744140625],[42.451171875,23.7744140625],[42.407226562499993,23.7744140625],[42.4072265625,23.73046875],[42.4072265625,23.6865234375],[42.4072265625,23.642578125]]]} |
Následující příklad vrátí hodnotu true kvůli neplatnému vstupu tokenu Geohash.
print invalid = isnull(geo_geohash_neighbors('a'))
Výstup
neplatné |
---|
1 |
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro