Deltares / ra2ce

RA2CE helps to quantify resilience of critical infrastructure networks, prioritize interventions and adaptation measures and select the most appropriate action perspective to increase resilience considering future conditions.
https://deltares.github.io/ra2ce/
Other
9 stars 2 forks source link

hazard_intersect_builder_for_gpkg #535

Open sahand-asgarpour opened 1 month ago

sahand-asgarpour commented 1 month ago

Ra2ce version checks

Reproducible example

Introduce a hazard file with the gpkg format.

Current behaviour

  1. ` def _from_geodataframe(self, hazard_overlay: GeoDataFrame) -> GeoDataFrame: gdf_crs_original = hazard_overlay.crs

    def geodataframe_overlay(hazard_shp_file: Path, ra2ce_name: str):
        gdf_hazard = read_file(str(hazard_shp_file))
    
        if hazard_overlay.crs != gdf_hazard.crs:
            hazard_overlay = hazard_overlay.to_crs(gdf_hazard.crs)`

UnboundLocalError: local variable 'hazard_overlay' referenced before assignment

  1. inundated fraction (key: fr) is missing

Desired behaviour

Error to be resolved.

Additional context

No response