geo_h3cell_neighbors()
適用於:✅Microsoft網狀架構✅Azure 數據✅總管 Azure 監視器✅Microsoft Sentinel
計算 H3 儲存格芳鄰。
深入瞭解 H3 單元格。
語法
geo_h3cell_neighbors(
h3cell)
深入瞭解 語法慣例。
參數
姓名 | 類型 | 必要 | 描述 |
---|---|---|---|
h3cell | string |
✔️ | H3 儲存格標記值,因為它是由 geo_point_to_h3cell() 計算。 |
傳回
H3 儲存格芳鄰的陣列。 如果 H3 儲存格無效,查詢將會產生 Null 結果。
注意
如果需要超過immidiidis的鄰居,請參閱 geo_h3cell_rings()。
範例
下列範例會計算 H3 單元格芳鄰。
print neighbors = geo_h3cell_neighbors('862a1072fffffff')
輸出
鄰居 |
---|
[“862a10727ffffffff”,“862a10707ffff”,“862a1070fff”,“862a10777ff”,“862a100dfff”,“862a100d7ffff”] |
下列範例會計算輸入 H3 單元格的陣列及其芳鄰。
let h3cell = '862a1072fffffff';
print cells = array_concat(pack_array(h3cell), geo_h3cell_neighbors(h3cell))
輸出
細胞 |
---|
[“862a1072fff”,“862a10727ffffffff”,“862a10707ff”,“862a10777ff”,“862a100dfff”,“862a100d7ffffffff”] |
下列範例會計算 H3 單元格多邊形 GeoJSON 幾何集合。
let h3cell = '862a1072fffffff';
print cells = array_concat(pack_array(h3cell), geo_h3cell_neighbors(h3cell))
| mv-expand cells to typeof(string)
| project polygons = geo_h3cell_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”:[[[-744646159,40.735376026215022],[-74.0469080296236,40 .727986222489115],[-74.060610712223664,40.696775140349033],[-74.029724408156682,40.672970047595463],[-73.985140983708192,40.680349049267583],[-73.971393761028622,40.7115439354393],[-74.002274646159,40.735376026215022]]}, {“type”:“Polygon”,“coordinates”:[[[-748383546617,40.790439140236963],[-74.064132193843633,240.783038509825],[-74.07783966534211,40.751803958414136],[-74.046908029686236,40.727986222489115],[-74.002274646159,40.735376026215022],[-73.988522328408948,40.76659438221254],[-74.019448383546617,40.790439140236963]]}, {“type”:“Polygon”,“coordinates”:[[[[-7439665342211,40.751803958414136],[-74.1224794808745,40 .744383587828388],[-74.1361375042681,40.713156370029125],[-74.105200409528 8,40.689365648097258],[-74.06061071223664,40.696775140349033],[-74.046908029686236,40.727986222489115],[-74.077839665342211,40.751803958414136]]}, {“type”:“Polygon”,“coordinates”:[[[-74.06061071223664,40.696775140349033],[-74.1052004095288,40 .689365648097258],[-74.118853750491638,40.65816192704628],[-74.0879619670209,40.634383824229609],[-74.04342228384933,40.641782462872115],[-74.029724408156682,40.67297004795463],[-74.060610712223664,40.696775140349033]]}, {“type”:“Polygon”,“coordinates”:[[[[-73.985140983708192,40.680349049267583],[-74.029724408156682,40.672970047595463],[-74.043422283844933,40.641782462872115],[-74.012581189358343,40.617990065981623],[-73.968047801220749,40.625358290164748],[-73.954305509472675,40.656529678451555],[-73.985140983708192,40.680349049267583]]}, {“type”:“Polygon”,“coordinates”:[[[-73.92676604813565,40.718903205013063],[-73.971393761028622,40.71154393543933],[-73.985140983708192,40.680349049267583],[-73.95430509472675,40.656529678451555],[-73.9097285156584433333,40.663878222244435],[-73.895936872069854,40.69505685239637],[-73.92676604813565,40.718903205013063]]}, {“type”:“Polygon”,“coordinates”:[[[[-734490490497629,40.773964402038523],[-73.988522328408948,40.766594382212254],[-74.00227446159,40.735376026215022],[-73.971393761028622,40.7115439354393],[-73.92676604813565,40.718903205013063],[-73.912969923470314,40.750105305345329],[-73.94384490497629,40.773964402038523]]}]}, “properties”: {“name”: “polygons”}} |
下列範例會計算代表 H3 單元格及其鄰近的多邊形等位。
let h3cell = '862a1072fffffff';
print cells = array_concat(pack_array(h3cell), geo_h3cell_neighbors(h3cell))
| mv-expand cells to typeof(string)
| project polygons = geo_h3cell_to_polygon(cells)
| summarize arr = make_list(polygons)
| project polygon = geo_union_polygons_array(arr)
輸出
多邊形 |
---|
{ “type”: “Polygon”, "coordinates": [[[ -73.926766604813565, 40.718903205013063],[ -73.912969923470314, 40.750105305345329],[ -73.943844904976629, 40.773964402038523],[ -73.988522328408948, 40.766594382212254],[ -74.019448383546617, 40.79043914023697],[ -74.064132193843633, 40.783038509825005],[ -74.077839665342211, 40.751803958414136],[ -74.1224794808745, 40.744383587828388],[ -74.1361375042681, 40.713156370029125],[ -74.1052004095288, 40.689365648097251],[ -74.118853750491638,40.658161927046628],[ -74.0879619670209, 40.6343838242296],[ -74.043422283844933, 40.641782462872115],[ -74.012581189358343, 40.617990065981623],[ -73.968047801220749, 40.625358290164755],[ -73.954305509472675, 40.656529678451555],[ -73.909728515658443, 40.663878222244442],[ -73.895936872069854, 40.695056852396377],[ -73.926766604813565, 40.718903205013063]]]} |
下列範例會傳回 true,因為無效的 H3 單元格標記輸入。
print invalid = isnull(geo_h3cell_neighbors('abc'))
輸出
無效 |
---|
1 |