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: 1. Load the DEM and DSM. 2. Compute the difference between the DSM and the DEM using the calculator. 3. Clean the difference to identify the buildings (apply a threshold on the difference, label and eliminate small patches, etc.). 4. (Optional) Set unmasked values to 1 to create a binary image. 5. Save the building map. .. image:: ../_static/buildings_fom_DSM_DEM/Wolf_DSM.png :width: 600 :align: center DSM array .. image:: ../_static/buildings_fom_DSM_DEM/Wolf_DEM.png :width: 600 :align: center DEM array .. image:: ../_static/buildings_fom_DSM_DEM/difference.png :width: 600 :align: center Compute the difference (DSM - DEM) .. image:: ../_static/buildings_fom_DSM_DEM/difference_only.png :width: 600 :align: center Analyzes the difference .. image:: ../_static/buildings_fom_DSM_DEM/difference_clean.png :width: 600 :align: center Clean the difference .. image:: ../_static/buildings_fom_DSM_DEM/difference_clean_result.png :width: 600 :align: center 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.