다음을 통해 공유


geo_geohash_neighbors()

Geohash 인접을 계산합니다.

에 대해 geohash자세히 알아보세요.

Syntax

geo_geohash_neighbors(geohash)

구문 규칙에 대해 자세히 알아봅니다.

매개 변수

이름 형식 필수 Description
geohash string ✔️ geo_point_to_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.4951 171875,23.73046875],[42.451171875,23.73046875],[42.451171875,23.6865234375]]},
{"type":"Polygon","coordinates":[[[42.407265625,23.642578125],[42.451171875,23.642578125],[42.4511718 75,23.6865234375],[42.4072265625,23.6865234375],[42.4072265625,23.642578125]]},
{"type":"Polygon","coordinates":[[[42.407265625,23.73046875],[42.451171875,23.73046875],[42.4511718 75,23.7744140625],[42.4072265625,23.7744140625],[42.4072265625,23.73046875]]],
{"type":"Polygon","coordinates":[[[42.4951171875,23.642578125],[42.5390625,23.642578125],[42.5390625,23.6865234375],[42.4951171875,23.6865234375],[42.4951171875,23.642578125]]]},
{"type":"Polygon","coordinates":[[[42.451171875,23.73046875],[42.4951171875,23.73046875],[42.4951171875,23.7744140625],[42.451171875,23.7744140625],[42.451171875,23.73046875]]],
{"type":"Polygon","coordinates":[[[42.407265625,23.6865234375],[42.451171875,23.6865234375],[42.451171875,23.73046875],[42.4072265625,23.73046875],[42.4072265625,23.6865234375]]},
{"type":"Polygon","coordinates":[[[42.4951171875,23.73046875],[42.5390625,23.73046875],[42.5390625,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.4951171 875,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)

출력

polygon
{"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