> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_H3ToGeom

Return the result of H3 function [cellsToMultiPolygon(cells)](https://h3geo.org/docs/api/regions#cellstolinkedmultipolygon--cellstomultipolygon).

Converts an array of Uber H3 cell indices into an array of Polygon geometries, where each polygon represents a hexagonal H3 cell.

<Tip>
  To convert a Polygon array to MultiPolygon, use [ST\_Collect](/reference/wherobots-db/geometry-data/editors/ST_Collect). However, the result may be an invalid geometry. Apply [ST\_MakeValid](/reference/wherobots-db/geometry-data/validation/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](/reference/wherobots-db/geometry-data/overlay/ST_Union) function.
</Tip>

## Signatures

```sql theme={"system"}
ST_H3ToGeom(cells: Array[Long])
```

## Parameters

<ParamField body="cells" type="Array[Long]" required>
  The cells value.
</ParamField>

## Return type

<ResponseField type="Array<Geometry>">
  The resulting geometry.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_H3ToGeom(ST_H3CellIDs(ST_GeomFromWKT('POINT(1 2)'), 8, true)[0], 1, true))
```

```
[POLYGON ((1.0057629565405093 1.9984665139177547, 1.0037116327309097 2.0018325249140068, 0.999727799357053 2.001163270465665, 0.9977951427833316 1.997128228393235, 0.9998461908217928 1.993762152933182, 1.0038301712104316 1.9944311839965523, 1.0057629565405093 1.9984665139177547))]
```

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_H3ToGeom/ST_H3ToGeom.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=56a536a02879c19e3336f42dd3a57ba8" alt="ST_H3ToGeom" width="400" height="200" data-path="images/sql-functions/ST_H3ToGeom/ST_H3ToGeom.svg" />
