Share via


geo_s2cell_to_polygon()

S2 Hücre dikdörtgen alanını temsil eden çokgeni hesaplar.

Syntax

geo_s2cell_to_polygon(s2cell)

Söz dizimi kuralları hakkında daha fazla bilgi edinin.

Parametreler

Ad Tür Gerekli Açıklama
s2cell string ✔️ geo_point_to_s2cell() tarafından hesaplandığı şekilde S2 hücre belirteci değeri. S2 hücre belirteci en fazla dize uzunluğu 16 karakterdir.

Döndürülenler

GeoJSON Biçiminde ve dinamik veri türünde çokgen. s2cell geçersizse, sorgu null bir sonuç üretir.

Not

S2 Hücre kenarları küresel jeodeziktir.

Örnekler

print s2cellPolygon = geo_s2cell_to_polygon("89c259")

Çıkış

s2cellPolygon
{
"type": "Polygon",
"koordinatlar": [[-74.030012249838478, 40.8012684339439], [-74.030012249838478, 40.72222262918358], [-73.935982114337421, 40.708880489804564], [-73.935982114337421, 40.787917134506841], [-74.030012249838478, 40.8012684339439]]]
}

Aşağıdaki örnek, S2 Hücre çokgenlerinin GeoJSON geometri koleksiyonunu bir araya getirmektedir.

datatable(lng:real, lat:real)
[
    -73.956683, 40.807907,
    -73.916869, 40.818314,
    -73.989148, 40.743273,
]
| project s2_hash = geo_point_to_s2cell(lng, lat, 10)
| project s2_hash_polygon = geo_s2cell_to_polygon(s2_hash)
| summarize s2_hash_polygon_lst = make_list(s2_hash_polygon)
| project bag_pack(
    "type", "Feature",
    "geometry", bag_pack("type", "GeometryCollection", "geometries", s2_hash_polygon_lst),
    "properties", bag_pack("name", "S2 Cell polygons collection"))

Çıkış

Sütun1
{
"type": "Feature",
"geometry": {"type": "GeometryCollection", "geometries": [
{"type": "Polygon", "coordinates": [[-74.030012249838478, 40.880202851376716], [-74.030012249838478, 40.8012684339439], [-73.935982114337421, 40.787917134506841], [-73.935982114337421, 40.866846163445771], [-74.030012249838478, 40.880202851376716]]},
{"type": "Polygon", "coordinates": [[-73.935982114337421, 40.866846163445771], [-73.935982114337421, 40.787917134506841], [-73.841906340776248, 40.774477568182071], [-73.841906340776248, 40.853401155678846], [-73.935982114337421, 40.866846163445771]]},
{"type": "Polygon", "coordinates": [[-74.030012249838478, 40.8012684339439], [-74.030012249838478, 40.72222262918358], [-73.935982114337421, 40.708880489804564], [-73.935982114337421, 40.787917134506841], [-74.030012249838478, 40.8012684339439]]}]
},
"properties": {"name": "S2 Hücre çokgenleri koleksiyonu"}
}

Aşağıdaki örnek, geçersiz s2cell belirteci girişi nedeniyle null bir sonuç döndürür.

print s2cellPolygon = geo_s2cell_to_polygon("a")

Çıkış

s2cellPolygon