Vectorizes a raster (grid) object based on its pixel value.
Syntax
setof record ST_Polygonize( raster rast,
integer bandnumber,
out geom geometry,
out id integer,
out value float8);Parameters
| Parameter | Required | Description |
|---|---|---|
rast | Yes | The input grid object. |
bandnumber | Yes | The band to vectorize. The value starts from 0. |
Example
The following example vectorizes band 1 of the raster stored in rast_table where id = 1:
SELECT ST_Polygonize(rast, 1) FROM rast_table WHERE id = 1;Input

Output
