다음을 통해 공유


geo_geohash_to_polygon()

지오하시 사각형 영역을 나타내는 다각형을 계산합니다.

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

Syntax

geo_geohash_to_polygon(geohash)

구문 규칙에 대해 자세히 알아보세요.

매개 변수

이름 형식 필수 Description
geohash string ✔️ geo_point_to_geohash()에서 계산한 지오하시 값입니다. geohash 문자열은 1~18자 사이여야 합니다.

반환

GeoJSON 형식동적 데이터 형식의 다각형입니다. geohash가 잘못된 경우 쿼리는 null 결과를 생성합니다.

참고

지오하시 가장자리는 직선이며 측지식이 아닙니다. geohash 다각형이 다른 계산의 일부인 경우 geo_polygon_densify()로 고정하는 것이 좋습니다.

예제

print GeohashPolygon = geo_geohash_to_polygon("dr5ru");

출력

GeohashPolygon
{
"type": "Polygon",
"좌표": [
[[-74.00390625, 40.7373046875], [-73.9599609375, 40.7373046875], [-73.9599609375, 40.78125], [-74.00390625, 40.78125], [-74.00390625, 40.7373046875]]]
}

다음 예제에서는 Geohash 다각형의 GeoJSON 기하 도형 컬렉션을 어셈블합니다.

// Geohash GeoJSON collection
datatable(lng:real, lat:real)
[
    -73.975212, 40.789608,
    -73.916869, 40.818314,
    -73.989148, 40.743273,
]
| project geohash = geo_point_to_geohash(lng, lat, 5)
| project geohash_polygon = geo_geohash_to_polygon(geohash)
| summarize geohash_polygon_lst = make_list(geohash_polygon)
| project bag_pack(
    "type", "Feature",
    "geometry", bag_pack("type", "GeometryCollection", "geometries", geohash_polygon_lst),
    "properties", bag_pack("name", "Geohash polygons collection"))

출력

열1
{
"type": "Feature",
"geometry": {"type": "GeometryCollection","geometries": [
{"type": "Polygon", "coordinates": [[-74.00390625, 40.78125], [-73.9599609375, 40.78125], [-73.9599609375, 40.8251953125],[ -74.00390625, 40.8251953125], [ -74.00390625, 40.78125]]]}
{"type": "Polygon", "coordinates": [[[ -73.9599609375, 40.78125], [-73.916015625, 40.78125], [-73.916015625, 40.8251953125], [-73.9599609375, 40.8251953125], [-73.9599609375, 40.78125]]]]
{"type": "Polygon", "coordinates": [[-74.00390625, 40.7373046875], [-73.95996099375, 40.7373046875], [-73.9599609375, 40.78125], [-74.00390625, 40.78125], [-74.00390625, 40.7373046875]]]]
},
"properties": {"name": "Geohash polygons collection"
}}

다음 예제에서는 잘못된 geohash 입력으로 인해 null 결과를 반환합니다.

print GeohashPolygon = geo_geohash_to_polygon("a");

출력

GeohashPolygon