pyflwdir.FlwdirRaster.basins#
- FlwdirRaster.basins(idxs=None, xy=None, ids=None, **kwargs)[source]#
Returns a (sub)basin map with a unique ID for every (sub)basin.
To return a subbasin map either linear indices or x,y coordinates of subbasin outlets should be provided. Additional key-word arguments are passed to the snap method to snap the outlets to a downstream stream.
By default, if IDs are not provided (sub)basin IDs start from 1. As the the background value of the basins map is zero, the IDs may not contain zeros.
- Parameters:
- Returns:
(sub)basin map
- Return type:
2D array of uint32