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

nd.vector.read_file(path, clip=None)[source]

Read a geospatial vector file.

Parameters
  • path (str) – The path of the file to read.

  • clip (shapely.geometry, optional) – A geometry to intersect the vector data.

Returns

Return type

geopandas.GeoDataFrame