-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
@RuudHurkmans; documentation suggests any rasterio raster will work for land-use: https://hkvconfluence.atlassian.net/wiki/spaces/DHYD/pages/598507527/Landgebruikskaart
This is not true as the land-use needs to be of signed integer type and -999 as nodata value:
HYDROLIB/hydrolib/dhydamo/io/drrreader.py
Lines 54 to 60 in 97f99b4
| lu_rast, lu_affine = self.unpaved.drrmodel.read_raster(landuse, static=True) | |
| lu_counts = zonal_stats( | |
| gpd.GeoDataFrame(catchments), | |
| lu_rast.astype(int), | |
| affine=lu_affine, | |
| categorical=True, | |
| all_touched=all_touched, |
Possible fixes:
- Include constraints in documentation: het formaat moet een raster zijn met -999 en met een "signed integer" waarde
- Fix code, e.g. feeding the raster to the
zonal_statsmodule in stead of the numpy array and the affine as by example in the rasterio documentation: https://pythonhosted.org/rasterstats/manual.html#zonal-statistics
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels