Skip to content

exposure out of bounds #441

@DirkEilander

Description

@DirkEilander

hydomt_fiat version checks

  • I have checked that this issue has not already been reported.
  • I have checked that this bug exists on the latest version of hydomt_fiat.

Reproducible Example / Current behaviour

When setting up road exposure from OSM we find that the exposure might be slightly outside of the model region, causing an "out of bounds" error in Delft-FIAT. Recently a clip_exposure_to_hazard_extent method has been added to fix this as option in the setup_hazard method. However, I would argue that already at the setup exposure step no exposure outside of the model region should be created. In my cases we first setup a basemodel with exposure and vulnerability and later update this model with hazard data. Ideally, the exposure is already correct in the first step and doesn't need to be updated every time you update the hazard.

Desired behaviour

Change the clip_exposure_to_hazard_extent method to a more general clip_exposure method with a geometry as input. This method can then already be called in the setup_exposure_* steps to make sure the data is sound when building it. When clipping based on the hazard map one single line is needed outside of the clip method to get the extent of the hazard map with geom=da.raster.box

Metadata

Metadata

Assignees

No one assigned

    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