geoutils.Vector.rasterize

geoutils.Vector.rasterize#

Vector.rasterize(ref=None, in_value=None, out_value=0, all_touched=False, out_dtype=None, res=None, shape=None, grid_coords=None, bounds=None, crs=None, *, chunksizes=None, mp_config=None, dask=False, **kwargs)[source]#

Rasterize vector to a raster or mask, with input geometries burned in.

Match-reference: a raster can be passed to match its resolution, bounds and CRS when rasterizing the vector.

Alternatively, user can specify a grid to rasterize on using xres, yres, bounds and crs. Only xres is mandatory, by default yres=xres and bounds/crs are set to self’s.

Burn value is set by user and can be either a single number, or an iterable of same length as self.ds. Default is an index from 1 to len(self.ds).

Parameters:
Return type:

TypeVar(RasterType, bound= RasterBase)

Returns:

Raster or mask containing the burned geometries.