ds.rst.polygonize() or Raster.polygonize()#
- RasterBase.polygonize(target_values='all', connectivity=4, band=1, data_name='id', strategy='label_stitch', mp_config=None)[source]#
Polygonize the raster into a vector of polygon geometries delineating target values.
- Parameters:
target_values (
int|float|integer[Any] |floating[Any] |tuple[int|float|integer[Any] |floating[Any],int|float|integer[Any] |floating[Any]] |list[int|float|integer[Any] |floating[Any]] |NDArray[floating[Any] |integer[Any]] |Literal['all']) – Value or range of values of the raster from which to create geometries (defaults to “all”, for which all unique pixel values of the raster are used).data_name (
str) – Data attribute name to be associated with target values in the output vector (defaults to “id”).strategy (
Literal['label_union','label_stitch','geometry_stitch']) – Strategy used to reconcile polygons across chunk boundaries. Defaults to"label_stitch"and has no effect for eager execution.
- Return type:
Vector- Returns:
Vector containing the polygonized geometries associated to target values.