Skip to main content

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.

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

RS_Polygonize(raster: Raster, band: Int)

Parameters

raster
Raster
required
The input raster.
band
Int
required
The band index (1-based) to polygonize.

Return type

An array of structs, each containing a polygon geometry and its corresponding pixel value.

Examples

SELECT RS_Polygonize(raster, 1) FROM my_raster_table
SELECT exploded.geom, exploded.value
FROM my_raster_table,
LATERAL VIEW explode(RS_Polygonize(raster, 1)) AS exploded