> ## 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.

# RS_Polygonize

Converts raster pixels into polygon geometries. For each connected region of pixels with the same value, returns a polygon geometry along with the pixel value. This is useful for vectorizing raster data.

## Signatures

```sql theme={"system"}
RS_Polygonize(raster: Raster, band: Int)
```

## Parameters

<ParamField body="raster" type="Raster" required>
  The input raster.
</ParamField>

<ParamField body="band" type="Int" required>
  The band index (1-based) to polygonize.
</ParamField>

## Return type

<ResponseField type="Array<Struct<geom: Geometry, value: Double>>">
  An array of structs, each containing a polygon geometry and its corresponding pixel value.
</ResponseField>

## Examples

```sql theme={"system"}
SELECT RS_Polygonize(raster, 1) FROM my_raster_table
```

```sql theme={"system"}
SELECT exploded.geom, exploded.value
FROM my_raster_table,
LATERAL VIEW explode(RS_Polygonize(raster, 1)) AS exploded
```
