Create a building maps from a DEM and a DSM
Note
DEM: Digital Elevation Model DSM: Digital Surface Model from the 2D simulation (DEM + buildings + walls + piers + …)
- Steps:
Load the DEM and DSM.
Compute the difference between the DSM and the DEM using the calculator.
Clean the difference to identify the buildings (apply a threshold on the difference, label and eliminate small patches, etc.).
(Optional) Set unmasked values to 1 to create a binary image.
Save the building map.

DSM array

DEM array

Compute the difference (DSM - DEM)

Analyzes the difference

Clean the difference

Result (before setting unmasked values to 1 if needed)
Attention
The result can be used in an inpainting algorithm to fill in the holes/gaps in the 2D results in order to compare flood inundations more easily.