pyflwdir.FlwdirRaster.vectorize#

FlwdirRaster.vectorize(mask: ndarray | None = None, xs: ndarray | None = None, ys: ndarray | None = None, direction: Literal['up', 'down'] = 'down', **kwargs) → list[dict][source]#

Return each selected flow path as a LineString feature.

Parameters:
  • mask (2D array of bool, optional) – Mask selecting cells to include in the flow paths.

  • xs (2D array of float, optional) – Rasters of cell-center x and y coordinates. Inferred from the affine transform if omitted.

  • ys (2D array of float, optional) – Rasters of cell-center x and y coordinates. Inferred from the affine transform if omitted.

  • direction ({"up", "down"}) – Flow direction used to trace the paths, by default ‘down’.

  • **kwargs (dict) – Additional maps sampled at each feature’s most downstream cell and included as feature properties.

Returns:

feats – LineString features, suitable for geopandas.GeoDataFrame.from_features.

Return type:

list of dict