pyflwdir.FlwdirRaster.geofeatures#
- FlwdirRaster.geofeatures(flowpaths: list[ndarray], xs: ndarray | None = None, ys: ndarray | None = None, **kwargs) list[dict][source]#
Return geographic features for flow paths represented by linear indices.
Coordinates are calculated from the affine transform at cell centers unless (subgrid) x- and y-coordinate rasters are provided.
- Parameters:
flowpaths (list of 1D arrays of int) – Flow paths described by linear indices.
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.
**kwargs (2D array-like) – Additional maps sampled at each feature’s most downstream cell and included as feature properties, for example strord=flw.stream_order().
- Returns:
feats – Geofeatures, to be parsed by e.g. geopandas.GeoDataFrame.from_features
- Return type: