geo_h3cell_to_polygon()
計算代表 H3 Cell 矩形區域的多邊形。
深入了解 H3 資料格。
語法
geo_h3cell_to_polygon(
h3cell)
深入瞭解 語法慣例。
參數
名稱 | 類型 | 必要 | Description |
---|---|---|---|
h3cell | string |
✔️ | 由 geo_point_to_h3cell () 計算的 H3 單元格標記值。 |
傳回
GeoJSON 格式和動態資料類型的多邊形。 如果 H3 資料格無效,則查詢將會產生 Null 結果。
注意
H3 資料格多邊形邊緣是直線而不是測地線。 如果 H3 資料格多邊形是其他計算的一部分,請考慮使用 geo_polygon_densify() 來緻密化。
範例
print geo_h3cell_to_polygon("862a1072fffffff")
輸出
print_0 |
---|
{ "type": "Polygon", "coordinates": [[[-74.0022744646159, 40.735376026215022], [-74.046908029686236, 40.727986222489115], [-74.060610712223664, 40.696775140349033],[ -74.029724408156682, 40.672970047595463], [-73.985140983708192, 40.680349049267583],[ -73.971393761028622, 40.71154393543933], [-74.0022744646159, 40.735376026215022]]] } |
下列範例會組合 H3 資料格多邊形的 GeoJSON 幾何集合。
// H3 cell GeoJSON collection
datatable(lng:real, lat:real)
[
-73.956683, 40.807907,
-73.916869, 40.818314,
-73.989148, 40.743273,
]
| project h3_hash = geo_point_to_h3cell(lng, lat, 6)
| project h3_hash_polygon = geo_h3cell_to_polygon(h3_hash)
| summarize h3_hash_polygon_lst = make_list(h3_hash_polygon)
| project bag_pack(
"type", "Feature",
"geometry", bag_pack("type", "GeometryCollection", "geometries", h3_hash_polygon_lst),
"properties", bag_pack("name", "H3 polygons collection"))
輸出
資料行1 |
---|
{ "type": "Feature", “geometry”: {“type”: “GeometryCollection”, “geometries”: [{“type”: “Polygon”,“coordinates”: [[-73.960963556213, 40.829061732419916], [-74.005691351383675, 40.821680937801922], [-74.019448383546617, 40.790439140236963], [-73.988522328408948, 40.76659438221254], [-73.943844904976629, 40.773964402038523], [-73.930043202964953、40.805189944379514]、[-73.960963556213、40.829061732419916]]}、 {"type": "Polygon", "coordinates": [[[-73.902385078754875, 40.867671551513595], [-73.94715685019348, 40.860310688399885], [-73.9609635556213, 40.829061732419916], [-73.930043202964953, 40.805189944379514], [-73.885321931061725, 40.812540084842404 ], [-73.871470551071766, 40.843772725733125], [ -73.902385078754875, 40.867671551513595]]]}, {"type": "Polygon","coordinates": [[[-73.943844904976629, 40.773964402038523], [-73.988522328408948, 40.766594382212254], [-74.0022744646159, 40.735376026215022], [-73.971393761028622, 40.71154393543933], [-73.926766604813565, 40.718903205013063], [ -73.912969923470314, 40.750105305345329 ], [-73.943844904976629, 40.773964402038523]]]}] }, "properties": {"name": "H3 polygons collection"} } |
由於 H3 資料格權杖輸入不正確,下列範例會傳回 Null 結果。
print geo_h3cell_to_polygon("@")
輸出
print_0 |
---|
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應