跳转至
🎉 SedonaDB 0.4.0 已正式发布!🗺️ 新增 Python DataFrame API、R dplyr 接口、Geography 支持及 GPU 加速空间连接。阅读发布博客 →

ST_S2ToGeom

Introduction: Returns an array of Polygons for the corresponding S2 cell IDs.

Hint

To convert a Polygon array to MultiPolygon, use ST_Collect. However, the result may be an invalid geometry. Apply ST_MakeValid to the ST_Collect output to ensure a valid MultiPolygon.

An alternative approach to consolidate a Polygon array into a Polygon/MultiPolygon, use the ST_Union function.

Format: ST_S2ToGeom(cellIds: Array[Long])

Return type: Array<Geometry>

Since: v1.6.0

SQL Example:

SELECT ST_S2ToGeom(array(11540474045136890))

Output:

[POLYGON ((-36.609392788630245 -38.169532607255846, -36.609392706252954 -38.169532607255846, -36.609392706252954 -38.169532507473015, -36.609392788630245 -38.169532507473015, -36.609392788630245 -38.169532607255846))]

ST_S2ToGeom