Skip to main content
Returns an array of Polygons for the corresponding S2 cell IDs.
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.

Signatures

ST_S2ToGeom(cellIds: Array[Long])

Parameters

cellIds
Array[Long]
required
The cell ids value.

Return type

The resulting geometry.

Example

SELECT ST_S2ToGeom(array(11540474045136890))
[POLYGON ((-36.609392788630245 -38.169532607255846, -36.609392706252954 -38.169532607255846, -36.609392706252954 -38.169532507473015, -36.609392788630245 -38.169532507473015, -36.609392788630245 -38.169532607255846))]
ST_S2ToGeom