Add automated structure impact assessment to flood pipeline#54
Open
cmspeed wants to merge 10 commits into
Open
Add automated structure impact assessment to flood pipeline#54cmspeed wants to merge 10 commits into
cmspeed wants to merge 10 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new automated impact analysis step to the flood pipeline to estimate the number of flooded structures within an Area of Interest (AOI). It evaluates the cumulative maximum flood extent (
MAX-EXTENT) against OpenStreetMap (OSM) building footprints using geometric intersection.Note: To run the impact analysis step the
disastersenvironment must be rebuilt using the updatedenvironment.ymlattached to this PR.Updates
A new file,
impact.py, adds functions for estimating the impact to OSM structures. This is integrated intorun_max_extent_pipeline. The structure impact analysis runs automatically in the background immediately after the maximum flood extent raster is successfully generated.To conserve memory and prevent OSM API timeouts, the script divides the raster into 15x15km (500x500 pixel) windows. It queries the OSM Overpass API for building footprints in chunks that actively contain flooded pixels.
The spatial logic guarantees accuracy for buildings smaller than a 30m pixel. It uses
all_touched=Trueto capture any water touching a structure, vectorizes those pixels intoShapelypolygons, and calculates the fractional overlap. A building is flagged as impacted if at least 50% of its exact footprint is covered by water.The pipeline automatically outputs two new datasets: a
.geojsonfile containing the impacted building footprints and a.csvcontaining the impacted building centroids.Updates to
environment.yml:- Added
osmnxto support the new OpenStreetMap building footprint queries.