geo_s2cell_neighbors()

S2 hücre komşularını hesaplar.

Syntax

geo_s2cell_neighbors(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ığı gibi S2 hücre belirteci değeri. S2 hücre belirteci en fazla dize uzunluğu 16 karakterdir.

Döndürülenler

S2 hücre komşularından oluşan bir dizi. S2 Hücresi geçersizse, sorgu null sonuç üretir.

Not

S2 Hücre kenarları küresel jeodeziktir.

Örnekler

Aşağıdaki örnek, S2 hücre komşularını hesaplar.

print neighbors = geo_s2cell_neighbors('89c259')

Çıkış

Komşu
["89c25d","89c2f9","89c251","89c257","89c25f","89c25b","89c2f7","89c2f5"]

Aşağıdaki örnek, komşularıyla birlikte bir giriş S2 hücresi dizisi hesaplar.

let s2cell = '89c259';
print cells = array_concat(pack_array(s2cell), geo_s2cell_neighbors(s2cell))

Çıkış

Hücre
["89c259","89c25d","89c2f9","89c251","89c257","89c25f","89c25b","89c2f7","89c2f5"]

Aşağıdaki örnek, S2 hücre çokgenleri GeoJSON geometri koleksiyonunu hesaplar.

let s2cell = '89c259';
print cells = array_concat(pack_array(s2cell), geo_s2cell_neighbors(s2cell))
| mv-expand cells to typeof(string)
| project polygons = geo_s2cell_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"))

Çıkış

geojson
{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [
{"type": "Polygon","coordinates": [[[ -74.030012249838478, 40.8012684339439],[ -74.030012249838478, 40.7222262918358],[ -73.935982114337421, 40.708880489804564],[ -73.935982114337421, 40.787917134506841],[ -74.030012249838478, 40.8012684339439]]},
{"type": "Polygon","coordinates": [[[ -73.935982114337421, 40.708880489804564],[ -73.935982114337421, 40.629736433321796],[ -73.841906340776248, 40.616308079144915],[ -73.841906340776248, 40.695446474556284],[ -73.9359821114337421, 40.708880489804564]]},
{"type": "Polygon","coordinates": [[[ -74.1239959854733, 40.893471289549765],[ -74.1239959854733, 40.814531536204242],[ -74.030012249838478, 40.8012684339439],[ -74.030012249838478, 40.880202851376716],[ -74.1239959854733, 40.893471289549765]]},
{"type": "Polygon","coordinates": [[[ -74.1239959854733, 40.735483949993387],[ -74.1239959854733, 40.656328734184143],[ -74.030012249838478, 40.643076628676461],[ -74.030012249838478, 40.7222262918358],[ -74.1239959854733, 40.735483949993387]]},
{"type": "Polygon","coordinates": [[[ -74.1239959854733, 40.814531536204242],[ -74.1239959854733, 40.735483949993387],[ -74.030012249838478, 40.72222262918358],[ -74.030012249838478, 40.8012684339439],[ -74.1239959854733, 40.814531536204242]]},
{"type": "Polygon","coordinates": [[[ -73.935982114337421, 40.787917134506841],[ -73.935982114337421, 40.708880489804564],[ -73.841906340776248, 40.695446474556284],[ -73.841906340776248, 40.774477568182071],[ -73.9359821114337421, 40.787917134506841]]},
{"type": "Polygon","coordinates": [[[ -74.030012249838478, 40.72222262918358],[ -74.030012249838478, 40.643076628676461],[ -73.935982114337421, 40.62973643321796],[ -73.935982114337421, 40.708880489804564],[ -74.030012249838478, 40.72222262918358]]},
{"type": "Polygon","coordinates": [[[ -74.030012249838478, 40.880202851376716],[ -74.030012249838478, 40.8012684339439],[ -73.935982114337421, 40.787917134506841],[ -73.935982114337421, 40.866846163445771],[ -74.0300122249838478, 40.880202851376716]]},
{"type": "Polygon","coordinates": [[[ -73.935982114337421, 40.866846163445771],[ -73.935982114337421, 40.787917134506841],[ -73.841906340776248, 40.774477568182071],[ -73.841906340776248, 40.853401155678846],[ -73.9359821114337421, 40.866846163445771]]}]},
"properties": {"name": "polygons"}}

Aşağıdaki örnek, S2 hücresini ve komşularını temsil eden çokgen birleşimleri hesaplar.

let s2cell = '89c259';
print cells = array_concat(pack_array(s2cell), geo_s2cell_neighbors(s2cell))
| mv-expand cells to typeof(string)
| project polygons = geo_s2cell_to_polygon(cells)
| summarize arr = make_list(polygons)
| project polygon = geo_union_polygons_array(arr)

Çıkış

Çokgen
{"type": "Polygon","coordinates": [[[-73.841906340776248,40.695446474556284],[-73.841906340776248,40.774477568182071],[-73.841906340776248,40.853401155678846],[-73.935982114337421,40.866846163445771],[-74.030012249838478,40.880202851376716],[-74.1239959854733,40.893471289549758],[-74.1239959854733,40.814531536204242],[-74.1239959854733,40.735483949993387],[-74.1239959854733,40.656328734184143],[-74.030012249838478,40.643076628676461],[- 73.935982114337421,40.629736433321796],[-73.841906340776248,40.616308079144915],[-73.841906340776248,40.695446474556284]]]}

Aşağıdaki örnek, geçersiz S2 Hücre belirteci girişi nedeniyle true değerini döndürür.

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

Çıkış

geçersiz
1