Skip to content

Commit

Permalink
Rework fill_depressions to use _output_handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
groutr committed Feb 14, 2024
1 parent 04b061b commit 4f0558e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pysheds/sgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2148,11 +2148,13 @@ def fill_depressions(self, dem, nodata_out=np.nan, **kwargs):
Raster representing digital elevation data with multi-celled
depressions removed.
"""
# Implementation detail of priority flood algorithm.
tuple_type = Tuple([from_dtype(dem.dtype), int64, int64])
dem_mask = self._get_nodata_cells(dem)
return _self._priority_flood(dem, dem_mask, tuple_type)

result = _self._priority_flood(dem, dem_mask)
dem_filled = self._output_handler(data=result,
viewfinder=dem.viewfinder,
metadata=dem.metadata,
nodata=dem.nodata)
return dem_filled

def detect_flats(self, dem, **kwargs):
"""
Expand Down

0 comments on commit 4f0558e

Please sign in to comment.