pywasp.raster_to_vector

pywasp.raster_to_vector(da, dz=None, gsize=None, polygons=True)[source]

Convert raster map to vector map

Warning

This function is experimental and its signature may change.

Parameters:
  • da (xarray.DataArray) – Raster map to be converted, should have a name of “elevation”, “roughness”, or “landcover”.

  • dz (float, optional) – Spacing of elevation in z-direction, only for elevation maps, by default 10 m

  • gsize (int, optional) – Precalculation grid size can increase on error, by default 1000000

  • as_geopandas (bool) – Convert to Geopandas based vector map or keep as _WaspVectorMap

  • polygons (bool) – Only relevant for landcover and roughness maps. Whether to convert the file to polygons, default True. If False, opens the file as change lines.

Returns:

_WaspVectorMap or geopandas.GeoDataFrame – Vector representation of the input raster map.