Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elevating new composite areas based on base flood maps bug fix #404

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion hydromt_fiat/workflows/exposure_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1903,6 +1903,10 @@ def set_height_relative_to_reference(
"Object ID", drop=False
)

# Ensure that the raise_by variable has the correct type
if not isinstance(raise_by, pd.Series):
raise_by = pd.Series(raise_by, index=exposure_to_modify.index)

# Find indices of properties that are below the required level
properties_below_level = (
exposure_to_modify.loc[:, "Ground Floor Height"]
Expand All @@ -1920,7 +1924,7 @@ def set_height_relative_to_reference(
original_df = exposure_to_modify.copy() # to be used for metrics
exposure_to_modify.loc[to_change, "Ground Floor Height"] = list(
modified_objects_gdf.loc[to_change, attr_ref]
+ raise_by
+ raise_by[to_change]
- exposure_to_modify.loc[to_change, "Ground Elevation"]
)

Expand Down
Loading