Skip to content

BUG in workflows.gis.ground_elevation_from_dem #504

@DirkEilander

Description

@DirkEilander

bug

The workflows.gis.ground_elevation_from_dem assumes only a single building can exist within a grid cell and uses a random filling of missing data values. Note that this is really problematic for impact assessments as the building elevation makes a huge!! difference on the results.

First all building ids are rasterized into a single grid at the resolution of the DEM, thus only one building can exist per grid cell.

rasterized = rasterize(

Then, and this is really problematic, a bffil is used to fill in gaps of buildings which don't have data because of the previous assumption. This uses data from random (i.e. the order of buildings is random!) other buildings.

exposure_db["ground_elevtn"].bfill(inplace=True)

possible solutions

  • use another filling algorithm by e.g. sampling from the rasterized building id map at the centroid of buildings with missing values.
  • use hydromt.raster.zonal_stats. much slower but it does the job right. There might also be other packages (a quick google search brought me to exactextract) that do this correctly.
  • use hydromt.raster.sample to get fast results based on the centroid.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions