次の方法で共有


geo_geohash_neighbors()

適用対象: ✅Microsoft FabricAzure データ エクスプローラーAzure MonitorMicrosoft Sentinel

Geohash ネイバーを計算します。

geohash に関する詳細をご覧ください。

構文

geo_geohash_neighbors(geohash)

構文規則について詳しく知る。

パラメーター

件名 タイプ Required 説明
geohash string ✔️ geo_point_to_geohash()によって計算された geohash 値。 geohash 文字列*は 1 ~18 文字でなければなりません。

返品

Geohash 近隣の配列。 Geohash が無効な場合、クエリによって null 結果が生成されます。

次の例では、Geohash ネイバーを計算します。

print neighbors = geo_geohash_neighbors('sunny')

出力

近隣
["sunnt","sunpj","sunnx","sunpn","sunnv","sunpp","sunnz","sunnw"]

次の例では、入力 Geohash とその近傍の配列を計算します。

let geohash = 'sunny';
print cells = array_concat(pack_array(geohash), geo_geohash_neighbors(geohash))

出力

セル
["sunny","sunnt","sunpj","sunnx","sunpn","sunnv","sunpp","sunnz","sunnw"]

次の例では、Geohash ポリゴン GeoJSON ジオメトリ コレクションを計算します。

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

出力

geojson
{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [
{"type":"Polygon","coordinates":[[[42.451171875,23.6865234375],[42.4951171875,23.6865234375],[42.495 1171875,23.73046875],[42.451171875,23.73046875],[42.451171875,23.6865234375]]},
{"type":"Polygon","coordinates":[[42.4072265625,23.642578125],[42.451171875,23.642578125],[42.451171 [875,23.6865234375],[42.4072265625,23.6865234375],[42.4072265625,23.642578125]]},
{"type":"Polygon","coordinates":[[42.4072265625,23.73046875],[42.451171875,23.73046875],[42.451171 [875,23.7744140625],[42.4072265625,23.7744140625],[42.4072265625,23.73046875]]},
{"type":"Polygon","coordinates":[[42.4951171875,23.642578125],[42.5390625,23.642578125],[42.539062 5,23.6865234375],[42.4951171875,23.6865234375],[42.4951171875,23.642578125]]},
{"type":"Polygon","coordinates":[[[42.451171875,23.73046875],[42.4951171875,23.73046875],[42.495117 1875,23.7744140625],[42.451171875,23.7744140625],[42.451171875,23.73046875]]},
{"type":"Polygon","coordinates":[[42.4072265625,23.6865234375],[42.451171875,23.6865234375],[42.451 171875,23.73046875],[42.4072265625,23.73046875],[42.4072265625,23.6865234375]]},
{"type":"Polygon","coordinates":[[[42.4951171875,23.73046875],[42.5390625,23.73046875],[42.539062 5,23.7744140625],[42.4951171875,23.7744140625],[42.4951171875,23.73046875]]},
{"type":"Polygon","coordinates":[[42.4951171875,23.6865234375],[42.5390625,23.6865234375],[42.5390625,23.73046875],[42.4951171875,23.73046875],[42.4951171875,23.6865234375]]},
{"type":"Polygon","coordinates":[[[42.451171875,23.642578125],[42.4951171875,23.642578125],[42.495117 1875,23.6865234375],[42.451171875,23.6865234375],[42.451171875,23.642578125]]}}
"properties": {"name": "polygons"}}

次の例では、Geohash とその近隣を表す多角形の和集合を計算します。

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)

出力

多角形
{"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]]]}

次の例では、Geohash トークンの入力が無効であるため、true を返します。

print invalid = isnull(geo_geohash_neighbors('a'))

出力

無効
1