safe/gis/vector/assign_highest_value.py
Function assign_highest_value
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def assign_highest_value(exposure, hazard):
"""Assign the highest hazard value to an indivisible feature.
For indivisible polygon exposure layers such as buildings, we need to
assigned the greatest hazard that each polygon touches and use that as the
Avoid deeply nested control flow statements. Open
Open
for index, value in zip(indices, area.attributes()):
update_map[building.id()][index] = value
# We don't want this building again, let's remove it from
# the index.