Checking for non-preferred file/folder path names (may take a long time depending on the number of files/folders) ...

Data used in "Understanding spatiotemporal patterns and drivers of urban flooding using municipal reports"


Authors:
Owners: This resource does not have an owner who is an active HydroShare user. Contact CUAHSI (help@cuahsi.org) for information on this resource.
Type: Resource
Storage: The size of this resource is 4.0 GB
Created: Sep 17, 2024 at 5:13 p.m.
Last updated: Sep 17, 2024 at 5:50 p.m.
Citation: See how to cite this resource
Content types: Single File Content 
Sharing Status: Public
Views: 71
Downloads: 3
+1 Votes: Be the first one to 
 this.
Comments: No comments (yet)

Abstract

This supports the article entitled "Understanding spatiotemporal patterns and drivers of urban flooding using municipal reports". This resource includes the R codes and data (imperviousness, rainfall, flood reports, topography, census data) used for the analysis.

This resource contains information from the “City of Denver Open Data Catalog” (http://data.denvergov.org)

Subject Keywords

Coverage

Spatial

Coordinate System/Geographic Projection:
WGS 84 EPSG:4326
Coordinate Units:
Decimal degrees
Place/Area Name:
City and County of Denver
Longitude
-105.0127°
Latitude
39.7481°

Temporal

Start Date:
End Date:

Content

readme.txt

Denver_flood_analysis.R – R script containing how to make figures for this project, and how to make/edit dataframes
Other files and folders contain datasets used in Denver_flood_analysis.R

1.	The first section of the R script loads in libraries and dataframes 
Set working directory
Set CRS (coord reference system necessary for spatial analysis. I set it to common_crs which is : +proj=longlat +datum=NAD83 +no_defs
Dataframes are listed and the comments detail what is in each DF.

2.	The middle section is how the dataframes were made
ServiceRequests (read in) 
code mostly filters service requests to specific area, time, and content of analysis
For example, here, we removed non-flooding service requests
ALERT_2014 (read in)
spatial data frame, the code only filters out rain gauges that had no data for the study period
####create polygons with rain gauges####
Input: ServiceRequest, Alert_2014
Output: creates voronoi_polygons_sf
#####Compilation of rain gauge data--saved to an Rfile####
Reads in rain gauge data from old MHFD url
Outputs rain.all.years
#####find what rain event data matches with service request data######
I am unsure what some of these lines are for
####the matching rain gage to polygon process, 
This section is about 15 loops of recreating polygons and matching service requests to rain gauges. If a service request was attached to a rain gauge with no data, the rain gauge was removed from the network and polygons were redrawn. This is currently commented out and takes some time to run.
This will all need to be uncommented, in order to run. I would recommend doing one loop at a time
Input: ServiceRequests_poly, rain.intensity.all
output: total_matched_data.RData 
####finished file connecting rain gauges to service requests ####
The step above this produces the Rdata file: total_matched_data.RData
(this contains information about the service request and the rain gauge it is matched to)
####Bringing in rain gauge data####
I think this is redundant plotting code and not too necessary
####finding distance between rain gauges and service requests
Uses total_matched_data and finds the distances from rain gauges to service requests
####histogram of distance before storms were matched
Code to create histogram for previous step
Input: total_matched_data
Output: a plot
#### calculate rainfall intensities w/ Rainmaker ####
Calculates storm characteristics from rainmaker package
Input: rain.allyears
Output: rain.intensity.all
####Pair service requests with storms ####
####total_matched_data (pairing flood reports to storms)####
Input: total_matched_data
Output: total_matched_data_with_stormID (service requests matched to rain gauges with storms attached)
	total_matched_data_without_stormID (service requests matched to rain gauges without storms)
####histograms of times reports happened
Different histograms trying to see when reports or storms happened
Input: total_matched_data_with_storm_ID, total_matched_data_without_stormID
####repeat for all storms(matched and unmatched to service requests) (used rain.intensity.all) ####
Histograms of when storms and reports are happening
####rain_intensity_matched, rain_intensity_not_matched####
input: total_matched_data_with_storm_ID, total_matched_data_without_stormID from previous steps
Output: rain_intensity_matched, rain_intensity_not_matched, rain_combined (these are used often later)
####what day during the multi-day storms did the storm happen?
This analysis is not complete but it began exploring storms which lasted longer than a few days
####Matthew's correlation coefficient####
Requires rain_combined
Output: MCC_summary which details the best performing storm characteristic and MCC value for threshold analysis
####CDF plots for I5
Requires rain_intensity_matched and rain_intensity_unmatched
####import census tract data
Reads in Denver tracts info from tigris package saved to denver_tracts
Attaches tract info to total_matched_data and outputs: total_matched_storm_census
####calc SR density:####
Calculates service request density
Input: Denver_tracts_polygons
Output: denver_tracts_polygons_pop_df$SR_per_person_per_km2, denver_tracts_polygons_pop_df$SR_per_person_per_mi2
####impervioussness####
Impervious data comes from impervious data file
####stormwater map
Data file comes from file in folder
####median income and other SES variables####
Pulls in from tidycensus package
Output:income_data and total_matched_storm_census$medIncome, total_matched_storm_census$MOEIncome
####SVI####
Read in SVI file for all of Colorado then filter to just Denver and select SVI for overall
Output: storm_tract_SR$SVIoverall
####DEM for TWI data and plotting####
Pull in multiple DEMs from DRCOG, mosaic them, set the CRS, then mask to get shape of Denver
masked_dem is a DEM of just Denver minus airport
calculate TWI and put into raster called twi
output: twi3.tif (the number comes from remaking the file and having to name it something new)
ServiceRequests2 is like ServiceRequests but also contains the TWI value for each service request
####finding TWI of random points (needs to be in impervious regions though)####
Requires impervious shapefile, twi, random points (set seed, pull random points from the impervious shapefile, set to correct crs)
Output: random_points_df, which has the random points’ TWI and Lat and Lon
####TWI violin plot####
(might be redundant with code alter on which uses differently named datafiles)
Input: ServiceRequests2, RandomPoints
Output: combined_df and a biolin plot comparing TWI of random points and points where service requests were
####all the violin plots####
There is a second section in figure 6 for violin plots, which I think may be preferable to this section 
(I’m considering removing this section)
Input: storm_tract_SR
Output: violin plots comparing  characteristics of storms that led to flood reports and those that didn’t/ violin plots comparing geographic characteristics of areas that did or did not lead to flood reports
####calculate means and medians####
Input:storm_tract_SR
Output: means and medians of all variables in storm_tract_SR
#####wilcox test for significance####
Input:storm_tract_SR
Output: wilcox test values
####normalizing variables--currently commented out####
Input:storm_tract_SR
Output: storm_tract_SR$’variable_name’_norm
####regression model --includes removing variables bc of VIF values
Input: storm_tract_SR 
Outputs: series of models and VIF results for combination of variables
####spatial regression####
Input: denver_tracts_polygons
Output: model outputs for spatial model
3.	This section is code for making figures which were used in the report
####Figure2
Input: denver_tracts_polygons, denver_tracts_polygons$SR_per_person_per_km2
####Figure3
total_matched_data,
total_matched_data_with_stormID,
total_matched_data_without_stormID,
rain_intensity_matched,
rain_intensity_not_matched,
rain_combined,
total_matched_data,
total_matched_data_with_stormID,
rain_combined,
rain_combined_geo,
voronoi_RG,
Denver_tracts_polygons,
ServiceRequests,
ALERT_2014
####Figure4
Input: total_matched_data
Repeat from above
####Figure 5####
repeat from above
Input: rain_combined, rain_intensity_matched, rain_intensity_not_matched
####Figure 6####
Repeat violin plots, but I would use this code before the other one above
Input: storm_tract_SR
####Figure 7
Input: Prism data, storm_tract_SR
Load in PRISM data and mask to the shape of Denver
Plot flood report points on top and save as an image
####Figure S1
Input: raster_df (also required for figure 7), storm_tract_SR
Plots points of flooding on top of prism data
####figure s2
Located with violin plot code
This is a violin plot of SVI
Input: storm_tract_SR, svi_overall

Credits

Funding Agencies

This resource was created using funding from the following sources:
Agency Name Award Title Award Number
National Science Foundation 2045340

How to Cite

DeSousa, S., A. S. Bhaskar (2024). Data used in "Understanding spatiotemporal patterns and drivers of urban flooding using municipal reports", HydroShare, http://www.hydroshare.org/resource/8af32fd732c34f078118d9cf0d3fd76d

This resource is shared under the Creative Commons Attribution CC BY.

http://creativecommons.org/licenses/by/4.0/
CC-BY

Comments

There are currently no comments

New Comment

required