raster_tools.Raster.to_vector#
- Raster.to_vector(as_polygons=False, neighbors=4)[source]#
Convert the raster to a vector.
- Parameters
as_polygons (bool, optional) – If
True
, the raster is converted to polygons/multi-polygon, each polyon/mult-polygon is made up of like-valued cells. Null cells are ignored.to_polygons()
for more information. IfFalse
, the raster is converted to points. Each non-null cell is a point in the output. Seeto_points()
for more information. Default isFalse
.neighbors ({4, 8} int, optional) – Used when as_polygons is
True
. This determines how many neighboring cells to consider when joining cells together to form polygons. Valid values are4
and8
.8
causes diagonal neighbors to be used. Default is4
.
- Returns
A GeoDataFrame. If as_polygons is
True
, the result is a dataframe with columns: value, band, geometry. The geometry column will contain polygons. IfFalse
, the result has columns: value, band, row, col, geometry. The geometry column will contain points.- Return type
dask_geopandas.GeoDataFrame
See also