nd.vector package¶
A submodule to deal with vector data.
-
nd.vector.
rasterize
(shp, ds, columns=None, encode_labels=True, date_field=None)[source]¶ Rasterize a vector dataset to match a reference raster.
- Parameters
shp (str or geopandas.geodataframe.GeoDataFrame) – Either the filename of a shapefile or an iterable
ds (xarray.Dataset) – The reference dataset to match the raster shape.
encode_labels (bool, optional) – If True, convert categorical data to integer values. The corresponding labels are accessible in the metadata. (default: True).
date_field (str, optional) – The name of field containing the timestamp.
- Returns
The rasterized features.
- Return type
xarray.Dataset or xarray.DataArray