RFlooding is a common natural disaster which can impact communities
across the nation and is particularly common to coastal communities at
threat from tropical systems, such as hurricanes. In the event of a
flood, to ensure safety of life, it is critical communities and
individuals understand and know evacuation routes; however, it is
possible some of these routes will be impacted by rising waters and no
longer accessible. While many cities have planned evacuation routes,
these routes do not normally include local roads nor do they take
factors which may inhibit travel, such as flooding, into account. Using
the coastal community of Virginia Beach, VA, as the case study, this
project will look to answer the question “what are the critical
nodes along evacuation routes under normal conditions
and where do these shift when the transportation network is impacted by
storm surge?” The project will use R and various packages,
such as sf and tidygraph to analyze the
transportation network of Virginia Beach and incorporate data from the
US Army Corps of Engineers to determine what areas are at risk of
flooding. Knowing what routes and critical nodes will
be inaccessible, and what new nodes will be revealed
due to flooding is critical to saving lives and keeping communities
safe, allowing individuals to plan their egress prior to an event, or in
the case of an unexpected event, during one. The analysis of the impact
of storm surge inundation during category 1-3 hurricanes did show that
critical nodes, and thus important routes, shifts west
along the Interstate 264 corridor and are associated with primary roads,
such as Independence Blvd, Lynnhaven Pkwy, and London Bridge Rd. During
a a category 4 hurricane, the inundation due to storm surge is so
extreme, Interstate 264 is impassable and critical
nodes shift north and west, still remaining with some
primary roads, but also involving local roads.
Flooding is a common natural disaster which can impact communities across the nation and normally occurs when there is a significant amount of rainfall over a prolonged period, or extremely intense rainfall over a short period. When this happens, the ground can no longer absorb additional water, nor can rivers or storm drains carry the additional water away (Flood Related Hazards, n.d.), and the excess water begins to pool in low lying areas. In coastal communities, flooding is typically caused by heavy rains and storm surge associated with tropical systems.
In the event of a flood, to ensure safety of life, it is critical communities and individuals understand and know evacuation routes; however, it is possible some of these routes will be impacted by rising waters and no longer accessible. While many cities have planned evacuation routes, most do not take vulnerability, or their “susceptibility to incidents that can result in considerable reductions in road network serviceability” (Taylor, 2008), into account. In other words, most evacuation routes do not account for the fact they may be flooded (Chen et al., 2006), leaving communities at risk of being cut off. City planners and emergency management personnel may not be aware of which street intersections, which are defined as nodes as part of graph theory, are critical during normal conditions and how the loss of those intersections, or nodes, due to flood may disrupt the network (Abenyake, et al., 2022). Additionally, much of the focus for evacuation planning is on interstates and major highways (Zhu et al., 2020), with little to no focus on the local roads and those within urban areas which are the primary means communities will access these major thoroughfares and more susceptible to the impacts of flooding (Abenyake, et al., 2022).
Using the coastal community of Virginia Beach, VA, as the case study, this project will look to answer the question “what are the critical nodes along evacuation routes under normal conditions, how is the network disrupted, and where do these critical nodes shift when the transportation network is impacted by storm surge?” This will be accomplished in three parts: first examining the transportation network of Virginia Beach to determine important nodes; second, determine locations susceptible to flooding ; and finally, examine which critical nodes on the transportation network are impacted during each category of hurricane and how those critical nodes shift.
For this project, prior to determining what critical nodes will be impacted by flooding, a transportation network analysis of the Virginia Beach roads needs to be completed. To then determine which of these roads will be impacted by storm surge, storm surge data is required.
For the transportation network analysis, local street data was
obtained from the Virginia
Beach open data portal. The street
data is available in various formats, to include ‘csv’ and
‘geojson’, but ‘shp’ files were chosen due to the
understanding of how to work with them within R. The
transportation network data does have important, albeit few, attributes
associated with it, such as road name and class (e.g. local, interstate,
alley, etc). Ancillary data about the roads, such as width, lanes, speed
limit, which could be used to determine capacity in future research, is
not available. Additionally, a significant piece of information missing
from the data set is road elevation, meaning all roads are assumed to be
at the same height (example: interstate overpass and road occupy the
same space in the z-plane). The road network is only for Virginia Beach,
so excludes connections to roads in the neighboring cities of Norfolk
and Chesapeake, to include interstates. Finally, and unfortunately,
there is no metadata associated with the dataset.
To determine storm surge, data from the US Army Corps of Engineers (USACE) Sea, Land, and Overland Surges from Hurricanes (SLOSH) data, available from Virginia Department of Emergency Management data portal was utilized. This dataset is a ‘shp’ file providing the maximum envelope of water (MEOW) based on hurricane category (i.e. CAT 1 through CAT 4). While the dataset does provide polygons showing extent of storm surge based on category of hurricane, it does not include any water depth data, meaning it shows where flooding will occur but not how deep it may be. Additionally, it does not account potential impacts from Tropical Depressions or Storms, nor does it account for rain induced flooding.
Prior to discussing the methodology of transportation network analysis, it is important to understand the theory behind it - graph theory. According to Faudree, graph theory is a “finite collection of elements, which are called vertices, and a finite collection of lines or curves, which are called edges, that join certain pairs of these vertices. In simpler terms, graph theory examines nodes that are connected by paths. Graph theory takes its roots from Euler’s solving of the “Seven Bridges of Koningsberg” problem. The problem boils down to this – can you walk across all 7 bridges only crossing each only once? Euler showed it is not possible, proving that at least one “node” had to have an even number for this to work (Baca and Flaherty, 2021), and thus graph theory was born.
Graph theory does not mean plotting of points with (x,y) coordinates and then connecting them. It could be, but it is more about the properties of the nodes and the paths which connect them. Figure 1 depicts the “Seven Bridges” and the conversion to graph theory plot, beginning with a realistic representation on the left, transformed into a familiar “lines and polygons” plot, finally being converted into “nodes and edges” on the right. With regards to mathematics, there are two key concepts – one is Euler’s Formula for planar graphs, where each node only has two edges, v – e + f = 2, where v = vertices (nodes), e = edges, and f = faces (or planes). The other concept is Dijkstra’s Algorithm which looks at the shortest path between one node and the others.
Graph theory has many different applications, such as social network analysis, neural network analysis, economics, and transportation network analysis to name a few. This is one of the key take-aways – graph theory can be applied to various events where two or more things are connected in some way. This connection does not need to be physical, and can occur outside of physical space (i.e. cyber space).
Transportation network analysis takes graph theory and applies it to road networks. It turns roads into edges and where those roads intersect into nodes. It can be used to examine various aspects of a transportation network, such as its importance which is taken from Metcalfe’s Law, where the importance is equal to the square of all the vertices (the more vertices the more important) (Rodrigue and Ducruet, 2022). A Network Centrality Analysis (NCA) can be conducted, which is an analytic method examining the importance of nodes and links, with centralities consisting of closeness centrality (CC) and betweenness centrality (BC). CC examines how quickly information flows through a given node to other nodes; BC is based on communication flow and how often a node is passed through during the shortest path flow between nodes. Essentially, these two measures examine how critical nodes and edges within a transportation network are.
With these measures, primarily CC and BC, critical points, or nodes, can be examined and how those critical nodes may shift with a disruption to the network. Additionally, shortest routes from an origin (O) to a destination (D), or O-D, can be analyzed and how those routes are affected should there be a disruption to the network.
The analysis of the transportation network of Virginia Beach, and the
impact of flooding on it, will follow a specific flow. Figure 2 depicts
the flow of data and analysis, with the left side of the flow chart
showing data wrangling and preperation. The right side of the flow chart
describes the transportation network analysis, which involves using
tidygraph to convert the transportation network into a
graph.
Prior to conducting transportation network analysis, the data sets described in section 2. Data need to be prepared. Prior to any code execution, required packages must be loaded. Instead of loading packages individually as needed, all packages are loaded at the beginning.
# Loading required packages for all data manipulation and analysis
library(tidyverse)
library(here)
library(sf)
library(rmapshaper)
library(janitor)
library(DT)
library(RColorBrewer)
library(mapview)
Upon review of the Virginia Beach Street Data, very little prep was
required prior to beginning analysis. The data was clipped using
ms_clip from the rmapshaper package to ensure
only roads within Virginia Beach were used. The rmapshaper
package was used over sf due to the speed - sf
functions ran much slower than those available in
rmapshaper. The clipping polygon, the Virginia
Beach borders, was obtained from the Virginia Beach open data
portal. Once clipped, road classes were grouped into three distinct road
types: Interstate; Primary; and Local. Finally, only specific attributes
were retained from the original shape file: objectid; full_name;
Road_type; shape_elen; and geometry.
# Reading in Shape Files for Streets
VaBeach_clip <- st_read(dsn = here("data/City_Boundary"))
interstate <- "INTERSTATE"
primary <- c("PRIMARY", "FEEDER", "MEDIAN BREAK", "RAMP")
local <- c("ALLEY", "LOCAL", "MILITARY", "MILITARY HOUSING", "PRIVATE")
Va_Beach_Streets <- st_read(dsn = here("data/Streets_Cleaned")) %>%
clean_names() %>%
ms_clip(VaBeach_clip) %>% # Clipping with city boundaries
mutate(Road_Type = case_when(class %in% interstate ~ "Interstate", # Slimming road type down to 3 classes
class %in% primary ~ "Primary",
class %in% local ~ "Local")) %>%
subset(select = c(objectid, full_name, Road_Type, shap_elen, geometry)) # Retaining specific attributes
# Street Map Plot
street_color <- c("red", "darkgreen", "blue")
mapview(Va_Beach_Streets, zcol = "Road_Type",
color = street_color,
lwd = 0.5, layer.name = "Road Type by Class") +
mapview(VaBeach_clip,
color = "black",
alpha.regions = 0,
lwd = 2,
legend = FALSE)
The SLOSH shape file from USACE is for the entire coast line of
Virginia. Since only Virginia Beach is required, the shape file was
clipped using the Virginia Beach border. Due to difficulties with
R, this was accomplished in ArcGIS Pro.
# Reading in Shape files for Storm Surge
Va_Beach_SLOSH <- st_read(here("data/Va_Beach_SLOSH", "Va_SLOSH.shp")) %>%
st_simplify(preserveTopology = FALSE, dTolerance = 50) %>% # Smoothin lines to make plotting faster
mutate_at("Category", as.factor) %>% # Changing the "dbl" to "factor" for plotting
arrange(desc(Category)) # Arranging so storm surge is depicted properly
colors <- c("red", "blue", "green", "purple") # Colors for Storm Surge
# Inundation Map Plot
# Inundation Map ----
mapview(Va_Beach_SLOSH, zcol = "Category",
col.regions = colors,
alpha.regions = 0.25, lwd = .001,
layer.name = "Storm Surge by Hurricane Category")
Figure 4 depicts the storm surge extent based on category of hurricane. Each set of poylgons is distinct and does not include information for a lower category of storm. In other words, to depict the storm surge inundation extent from a category 2 hurricane, both the category 1 and category 2 polygons would need to be plotted. Since this would make it difficult to use the storm surge inundation extent to clip streets, the borders for each category of hurricane were dissolved to incorporate all lower categories. Again, this was done in ArcGIS Pro. Additionally, the shape files were projected from NAD83 to WGS84 to match the coordinate reference system (CRS) of the street networks.
# Shape files with borders dissolved - prepped in ArcGIS Pro
CAT1 <- st_read(dsn = here("data/Va_Beach_SLOSH/Va_Beach_SLOSH_WGS84", "VaBeach_CAT1_WGS84.shp"))
CAT2 <- st_read(dsn = here("data/Va_Beach_SLOSH/Va_Beach_SLOSH_WGS84", "VaBeach_CAT2_WGS84.shp"))
CAT3 <- st_read(dsn = here("data/Va_Beach_SLOSH/Va_Beach_SLOSH_WGS84", "VaBeach_CAT3_WGS84.shp"))
CAT4 <- st_read(dsn = here("data/Va_Beach_SLOSH/Va_Beach_SLOSH_WGS84", "VaBeach_CAT4_WGS84.shp"))
# Cleaning up shape files
CAT1 <- clean_names(CAT1) %>%
select(-c("shape_le_1")) %>% # Dropping duplicate length
st_cast("POLYGON")
CAT2 <- clean_names(CAT2) %>%
st_cast("POLYGON")
CAT3 <- clean_names(CAT3) %>%
st_cast("POLYGON")
CAT4 <- clean_names(CAT4) %>%
st_cast("POLYGON")
With the streets and storm surge vector datasets created, the
intersection of the storm surge polygons with the street polylines can
be found, erasing streets which are flooded. This is done using
ms_erase from the rmapshaper package due to
its speed compared to similar functions in sf.
Additionally, a category of storm is added to the each street
sf object for facet wrapping.
CAT1_streets <- ms_erase(Va_Beach_Streets, CAT1) %>% # Clipping Roads and adding a "category" attribute
st_cast("LINESTRING") %>% # Need to recast as a LINESTRING for tidygraph
mutate("category" = as.factor(1))
CAT2_streets <- ms_erase(Va_Beach_Streets, CAT2) %>%
st_cast("LINESTRING") %>%
mutate("category" = as.factor(2))
CAT3_streets <- ms_erase(Va_Beach_Streets, CAT3) %>%
st_cast("LINESTRING") %>%
mutate("category" = as.factor(3))
CAT4_streets <- ms_erase(Va_Beach_Streets, CAT4) %>%
st_cast("LINESTRING") %>%
mutate("category" = as.factor(4))
For display and comparison purposes only, all categories of
inundation and impacted streets are combined into respective
sf objects using rbind, which appends the
objects together. Each new sf object is then simplified
(i.e. downsampling the resolution of the vecotrs) using
st_simplify to make plotting faster. Finally, the
sf objects are arranged in descending order, from category
4 down, to allow for plotting. With this complete, the storm surge
inundation can be plotted along with the impacted roads.
# Combining Shapefiles for a facetwrap plot
all_CATS <- rbind(CAT1, CAT2, CAT3, CAT4) %>%
mutate_at("category", as.factor) %>% # Changing numerical values to factors
st_simplify(preserveTopology = TRUE, dTolerance = 50) %>% # Simplifying shapes so plotting is quicker
arrange(desc(category)) # Will not show 4 plots unless descending order
all_roads <- rbind(CAT1_streets, CAT2_streets, CAT3_streets, CAT4_streets) %>%
st_simplify(preserveTopology = TRUE, dTolerance = 50) %>% # Simplifying shapes so plotting is quicker
arrange(desc(category))
# Faceted Inundation Map
all_in_roads <- ggplot() +
geom_sf(data = all_CATS, aes(col = category, fill = category,), alpha = 0.25) +
scale_fill_manual(name = "Category", # Setting Colors to match interactive map
values = c("1" = "red",
"2" = "blue",
"3" = "green",
"4" = "purple"),
labels = c("1", "2", "3", "4")) +
scale_color_manual(values = c("1" = "red",
"2" = "blue",
"3" = "green",
"4" = "purple"),
guide = "none") +
geom_sf(data = all_roads, aes(col = "black")) + # Plotting roads with inundation
theme_minimal() +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + # Rotating Longitude to be readable
labs(title = "Storm Surge Inundation Based on Hurricane Category",
subtitle = "Depicts Remaing Roads") +
facet_wrap(~category)
With the roads clipped based on storm surge, the roads need to be
converted to a transportation network of edges and
nodes. This was done using tidygraph and
sf tools based on a tutorial provided by Lucas van der Meer
on spatial
networks. tidy_graph allows for various types of
network analysis. It stores lists of data in a table graph
(tbl_graph) allowing for various attributes for
edges and nodes to be stored
simultaneously, being accessible by “activating” either of them prior to
conducting analysis.
For the comparison of impact of flooding on the transportation
network, edges and nodes will be
calculated for the unimpacted transportation network, or baseline, and
each category of storm, requiring these calculations to be conducted 5
times for conversion to a tbl_graph. To simplify this, a
separate function was written.
The sf_to_tidygraph function takes a road network of
type sf as an input and outputs a tbl_graph
full of edges and nodes. The function,
shown below, details each step of the process. First,
edges are given an edgeID to identify each. Next,
nodes are created at the start and end of each
edge and then only ‘start’ and ‘end’ are retained by
the slice function. Nodes are then given
(x,y) coordinates and unique IDs. Nodes are then
combined with their respective edges, being placed at
either the start or end of the line, as appropriate. ‘To’
node and ‘from’ node are then added to
each edge, duplicate nodes are removed
and a tbl_graph is returned. Of note, these road networks
are of a non-planar variety, meaning there is a “third dimension” or, in
other words, edges can cross over other
edges without creating a node
(Rodirgue and Ducruet, n.d.). An example of this is an interstate
crossing over a local road in the form of a overpass.
# Creating a function to convert shape files to tidygraph for network analysis
sf_to_tidygraph = function(x, directed = TRUE){
library(tidyverse)
library(sf)
library(tidygraph)
# Creating Nodes and Edges ----
# Give each edge a unique ID
edges <- x %>%
mutate(edgeID = c(1:n()))
# Creating nodes at the start and end point of each edge ----
nodes <- edges %>%
st_coordinates() %>% # Getting coordinates from edges
as_tibble() %>% # Creates a tibble
rename(edgeID = L1) %>% # Corresponding points to edgeID
group_by(edgeID) %>% # Groups by edgeID
slice(c(1, n())) %>% # Selects first and last occurrence of edge (start and end)
ungroup() %>%
mutate(start_end = rep(c('start', 'end'), times = n()/2)) # Replicates start and end, alternating
# Giving unique index to nodes ----
nodes <- nodes %>%
mutate(xy = paste(.$X, .$Y)) %>% # Combines points to coordinate pair
mutate(nodeID = group_indices(., factor(xy, levels = unique(xy)))) %>% # Generates unique ID based on coord pair
select(-xy) # Removes coord pair
# Combining nodes with edge ----
source_nodes <- nodes %>% # Nodes at start of edge
filter(start_end == "start") %>%
pull(nodeID)
target_nodes <- nodes %>% # Nodes at end of edge
filter(start_end == "end") %>%
pull(nodeID)
# Adding to and from nodes to edges table ----
edges <- edges %>%
mutate(from = source_nodes, to = target_nodes)
# Remove Duplicate nodes ----
nodes <- nodes %>%
distinct(nodeID, .keep_all = TRUE) %>% # Keeping unique nodes
select(-c(edgeID, start_end))%>% # Removing edgeID and start_end columns
st_as_sf(coords = c("X", "Y")) %>% # Creating "points" from XY coords
st_set_crs(st_crs(edges)) # Setting CRS to match edges
# Converting to graph for analysis ----
# Need to convert edges to df vice sf
graph <- tbl_graph(nodes = nodes, edges = as_tibble(edges), directed = FALSE)
To execute the function, it is called and loaded as a function, similar to loading packages, and then called like a function.
source(here("scripts", "sf_to_tidygraph.R")) # Loading function to convert SF to a tidygraph
# Calling function to create tbl_graph for network analysis
baseline_street_graph <- sf_to_tidygraph(Va_Beach_Streets) # Baseline Streets before flooding
CAT1_street_graph <- sf_to_tidygraph(CAT1_streets) # CAT 1 Streets
CAT2_street_graph <- sf_to_tidygraph(CAT2_streets) # CAT 2 Streets
CAT3_street_graph <- sf_to_tidygraph(CAT3_streets) # CAT 3 Streets
CAT4_street_graph <- sf_to_tidygraph(CAT4_streets) # CAT 4 Streets
datatable(baseline_street_graph %>% activate(edges) %>% as_tibble() %>% slice(1:10))
## Reading layer `table_edges' from data source
## `D:\MSDS\GEOG-588\Term Project\data\final_data\table_edges.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 10 features and 10 fields
## Geometry type: LINESTRING
## Dimension: XY
## Bounding box: xmin: -76.17753 ymin: 36.73905 xmax: -75.9427 ymax: 36.91333
## Geodetic CRS: WGS 84
Table 1. “Baseline”
streets. Depicts the first few rows of the
edges portion of the
tbl_graph for the Virginia Beach transportation network
prior to storm surge inundation, or the “baseline.” ‘To’ and ‘from’
nodes are associated with each
edge .
datatable(baseline_street_graph %>% activate(nodes) %>% as_tibble() %>% slice(1:10))
## Reading layer `table_nodes' from data source
## `D:\MSDS\GEOG-588\Term Project\data\final_data\table_nodes.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 10 features and 4 fields
## Geometry type: POINT
## Dimension: XY
## Bounding box: xmin: -76.13674 ymin: 36.75976 xmax: -75.99408 ymax: 36.82274
## Geodetic CRS: WGS 84
Table 2. “Baseline”
streets. Depicts the first few rows of the
nodes portion of the
tbl_graph for the Virginia Beach transportation network
prior to storm surge inundation, or the “baseline.”
# Plot of Baseline Streets Edges and Nodes ----
baseline_street_plot <- ggplot() +
geom_sf(data = baseline_street_graph %>%
activate(edges) %>% # Activates the edges for plotting
as_tibble() %>% # Converts df to a tibble
st_as_sf()) + # Converts tibble to an SF object for plotting
geom_sf(data = baseline_street_graph %>%
activate(nodes) %>%
as_tibble() %>%
st_as_sf(),
color = "red",
size = 0.25) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + # Rotating Longitude to be readable
labs(title = "Virginia Beach Edges and Nodes",
subtitle = "Prior to any storm surge inundation")
With the transportation network converted into a graph of
edges and nodes, the
betweenness centraility is calculated for
nodes and edges for each graph
(baseline and flooded). The betweenness is a measure of how
many routes pass through a node during a shortest path
route analysis. The larger the number, the more paths passing through
and the more important, or critical, the node is to the
network. Due to the amount calculations needed, a function was once
again created to calculate betweenness 5 separate
times.
The graph_betweenness function takes a graph as an
argument and calculates the length of each edge. In the
next step, nodes are activated and the
degree of each node is calculated, which is a measure
of how many edges connect to the node.
Next, the betweenness is calculated for each node. For
plotting purposes, the betweenness value, which is in the
‘millions’ in some cases is divided by 100,000. With
node betweenness calculated,
edge betweenness is calculated and again
scaled.
# Calculate betweenness
graph_betweenness = function(x_graph, directed = TRUE){
library(tidyverse)
library(sf)
library(tidygraph)
x_graph <- x_graph %>%
activate(edges) %>% # Activating Edges as the desired object to work with
mutate(length = st_length(geometry)) # Calculating length of each edge
x_graph <- x_graph %>%
activate(nodes) %>%
mutate(degree = centrality_degree()) %>% # Calculate how many edges intersect each node
mutate(betweenness = centrality_betweenness(weights = length)) %>% # Calculate how many routes pass through
# a node on a shortest path
mutate(btwn_scale = betweenness / 100000) %>% # Scaling the number from millions for display
activate(edges) %>%
mutate(betweenness = centrality_edge_betweenness(weights = length)) %>%# Calculate how many routes pass through
# an edge on a shortest path
mutate(btwn_scale = betweenness / 100000) # Scaling the number from millions for display
}
source(here("scripts", "graph_betweenness.R")) # loading function to calculate betweenness
# Calling function to calculate betweenness
baseline_street_graph <- graph_betweenness(baseline_street_graph)
CAT1_street_graph <- graph_betweenness(CAT1_street_graph)
CAT2_street_graph <- graph_betweenness(CAT2_street_graph)
CAT3_street_graph <- graph_betweenness(CAT3_street_graph)
CAT4_street_graph <- graph_betweenness(CAT4_street_graph)
datatable(baseline_street_graph %>% activate(edges) %>% as_tibble() %>% slice(1:10))
## Reading layer `table_edges_btwn' from data source
## `D:\MSDS\GEOG-588\Term Project\data\final_data\table_edges_btwn.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 10 features and 10 fields
## Geometry type: LINESTRING
## Dimension: XY
## Bounding box: xmin: -76.17753 ymin: 36.73905 xmax: -75.9427 ymax: 36.91333
## Geodetic CRS: WGS 84
Table 3 “Baseline” street data with
betweenness. Depicts the first few rows of the
edges portion of the
tbl_graph. The difference from previous list is the
inclusion of ‘betweenness.’ Because the calculated value can range from
0 to in the millions, the value was scaled for plotting
purposes.
datatable(baseline_street_graph %>% activate(nodes) %>% as_tibble() %>% slice(1:10))
## Reading layer `table_nodes_btwn' from data source
## `D:\MSDS\GEOG-588\Term Project\data\final_data\table_nodes_btwn.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 10 features and 4 fields
## Geometry type: POINT
## Dimension: XY
## Bounding box: xmin: -76.13674 ymin: 36.75976 xmax: -75.99408 ymax: 36.82274
## Geodetic CRS: WGS 84
Table 4 “Baseline” street data with
betweenness. Depicts the first few rows of the
nodes portion of the
tbl_graph. The difference from previous list is the
inclusion of ‘betweenness.’ Because the calculated value can range from
0 to in the millions, the value was scaled for plotting
purposes.
The data examined in each tbl_graph contains thousands
to tens of thousands of observations. To focus on the
nodes with higher importance, or “betweenness,” the
variable “btwn_scale” was grouped into different bins to determine where
to slice the data. Since the baseline street data had the
most nodes, the value was determined by using
“btwn_scale” count.
# Examining Top 'x' Nodes ----
btwn <- baseline_street_graph %>% activate(nodes) %>% as_tibble %>% pull("btwn_scale") #Pulling just btwn_scale
breaks <- c(0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250) # Break points
tags <- c("0-25", "25-50", "50-75", "75-100", "100-125",
"125-150", "150-175", "175-200", "200-225", "225-250") # Labels for bins
group_tags <- cut(btwn, breaks = breaks, include.lowest = TRUE, right = FALSE, labels = tags) # Binning values
summary(group_tags) # Count of values per bin
Table 5 “Betweenness” Bins. Table shows the amount of nodes with scaled “betweenness” values in the 10 bins. Most values are in the ‘0-25’ bin, meaning there importance is very low.
Based on this review of “betweenness” values, it was determined to
focus on nodes and the associate roads connected to
them, with value ranges from 125-250, the top 70 nodes,
or ~0.4% of all the nodes in the transportation
network. With this value, the tbl_graphs for the baseline
streets and each category of hurricane were filtered to the top 70
nodes and then roads associated with those nodes was
found. Since this needed to be done multiple times, two new functions
were written to execute this.
# Function to read top "x" nodes in a graph
top_nodes = function(x, graph){
library(tidygraph)
library(sf)
library(tidyverse)
top_nodes <- graph %>%
activate(nodes) %>%
as_tibble %>%
st_as_sf %>%
arrange(desc(btwn_scale)) %>%
slice(1:x)
}
# Function to pull Roads associated with top nodes
top_roads = function(nodes, graph){
library(tidygraph)
library(tidyverse)
library(sf)
node_list <- pull(nodes, "nodeID")
top_roads <- graph %>%
activate(edges) %>%
as_tibble() %>%
st_as_sf() %>%
filter(from %in% node_list | to %in% node_list)
}
source(here("scripts", "top_nodes.R")) # Loading function to return df with top nodes
source(here("scripts", "top_roads.R")) # Loading functiuon to return df with roads associated with top nodes
# Filtering all `tbl_graphs` to find the top nodes
x = 70
base_top_nodes <- top_nodes(x, baseline_street_graph)
base_top_roads <- top_roads(base_top_nodes, baseline_street_graph)
CAT1_top_nodes <- top_nodes(x, CAT1_street_graph) %>%
mutate("category" = as_factor(1))
CAT1_top_roads <- top_roads(CAT1_top_nodes, CAT1_street_graph)
CAT2_top_nodes <- top_nodes(x, CAT2_street_graph) %>%
mutate("category" = as_factor(2))
CAT2_top_roads <- top_roads(CAT2_top_nodes, CAT2_street_graph)
CAT3_top_nodes <- top_nodes(x, CAT3_street_graph) %>%
mutate("category" = as_factor(3))
CAT3_top_roads <- top_roads(CAT3_top_nodes, CAT3_street_graph)
CAT4_top_nodes <- top_nodes(x, CAT4_street_graph) %>%
mutate("category" = as_factor(4))
CAT4_top_roads <- top_roads(CAT4_top_nodes, CAT4_street_graph)
With betweenness calculated for the baseline transportation network, or the transportation network prior to impact from storm surge, and for each category of hurricane, the impacts on the transportation network can be examined to ascertain how the critical nodes shift.
First, the baseline street network is examined. Of the top 70 nodes, the most critical are associated with 4 roadways: Interstate 264, Independence Blvd, London Bridge Rd, and Lynnhaven Pkwy. This makes sense as these are four of the primary roads in Virginia Beach with the first running east-west and the others predominantly north-south. For the betweenness, the values for each node can be seen in table 5, with scaled betweenness values for the top 10 rangling between 230+ and 180+. Since this provides little value, the roads associated with each of these nodes is depicted in table 6 and are sorted by their own scaled betweenness value, which is very close to those of the top nodes.
# Table of the nodes associated with the baseline streets
base_top_nodes %>%
arrange(desc(btwn_scale)) %>%
datatable()
Table 5. Top 70 Nodes - Baseline Transportation Network. This list depicts top 70 nodes prior to any impacts from storm surge inundation.
# Table of the top roads for the baseline streets
base_top_roads %>%
arrange(desc(btwn_scale)) %>%
datatable()
Table 6. Roads Associated with Top 70 Nodes. This list depicts the all the roads associated with the top 70 nodes prior to any impacts from storm surge inundation. This does show that Interstate 264, Independence Blvd, Lynnhaven Pkwy, and London Bridge Rd are the most critical roads connected to the top nodes.
Figure 7 is an interactive map of the top 70 nodes plotted with the road network. Figure 8 is a static image zoomed in to depict the top roads. From these figures, it can be seen top nodes and their associated roads occur across Virginia Beach, with some in the center of the city, some to the west and some south of central Virginia Beach.
# Plotting Node Betweenness
btwn_breaks <- c(0, 50, 100, 150, 200, 250) # Break points for betweenness plot
mapviewOptions(basemaps = "CartoDB.Positron") # Setting basemap
mapx <- mapview(base_top_nodes, zcol = "btwn_scale", size = "btwn_scale",
color = "black", lwd = 0.25,
col.regions = brewer.pal(6, "YlOrRd"), alpha = 1, at = btwn_breaks,
layer.name = "Node Betweenness (Scaled by 100,000)") +
mapview(Va_Beach_Streets, zcol = "Road_Type", color = street_color,
lwd = 0.75, layer.name = "Roads by Class")
mapx
Next, the impact on the transportation network due to storm surge from a category 1 hurricane is examined. One of the first items the comes out is the value of betweenness has decreased by a significant amount (approx. 100,000 for betweenness and 100 for btwn_sclaed) for the top nodes, which can be seen in table 7. This makes sense as there are fewer edges and nodes to requiired calculate betweenness. In table 8, other than two nodes associated with S. Rosemont Rd, the top nodes are primarily associated with Independence Blvd.
# Table of the nodes associated with the CAT1 streets
CAT1_top_nodes %>%
arrange(desc(btwn_scale)) %>%
datatable()
Table 7. Top 70 Nodes - Baseline Transportation Network. This list depicts top 70 nodes after impact from storm surge associated with a CAT 1 hurricane.
Table 8. Roads Associated with Top 70 Nodes. This list depicts the all the roads associated with the top 70 nodes after they have been impacted by inundation from storm surge due to a Category 1 hurricane. This does show that —— are the most critical roads leading to nodes.
Figure 9 is an interactive map of the top 70 nodes after the impact associated with storm surge from a category 1 hurricane. Additionally, the storm surge and remaining roads are plotted. Figure 10 is a static image zoomed in to depict Independence Blvd and the top nodes. From these figures, it can be seen top nodes and their associated roads occur in the western portion of Virginia Beach near Interstate 264.
# Plot of the top nodes associated with a CAT 1 hurricane
map1 <- mapview(CAT1_top_nodes, zcol = "btwn_scale", size = "btwn_scale",
color = "black", lwd = 0.25,
col.regions = brewer.pal(6, "YlOrRd"), alpha = 1, at = btwn_breaks,
layer.name = "Node Betweenness (Scaled by 100,000)") +
mapview(CAT1_streets, zcol = "Road_Type", color = street_color,
lwd = 0.75, layer.name = "Roads by Class") +
mapview(CAT1, lwd = 0.01,
col.regions = "red", alpha.regions = 0.25,
layer.name = "CAT 1 Storm Surge")
map1
Next, the impact on the transportation network due to storm surge from a category 2 hurricane is examined. Again, one of the first items the comes out is the value of betweenness has increased by a significant amount (approx. 100,000 for betweenness and 100 for btwn_sclaed) for the top nodes, which can be seen in table 9. This is likely due to the fact there are now less shortest paths available, so the remaining nodes increase in their importance. In table 9, there are two main roads associated with these top nodes, Witchduck Rd and Princess Anne Rd.
# Table of the nodes associated with the CAT2 streets
CAT2_top_nodes %>%
arrange(desc(btwn_scale)) %>%
datatable()
Table 9. Top 70 Nodes - Baseline Transportation Network. This list depicts top 70 nodes after impact from storm surge associated with a CAT 2 hurricane.
# Top Roads in descending order based on Btwn
CAT2_top_roads %>%
arrange(desc(btwn_scale)) %>%
datatable()
Table 10. Roads Associated with Top 70 Nodes. This list depicts the all the roads associated with the top 70 nodes after they have been impacted by inundation from storm surge due to a Category 2 hurricane. This does show that Witchduck Rd and Princess Anne Rd are the most critical roads leading to nodes.
Figures 11 and 12 depict the impact of storm surge on the transportation network, with figure 11 an interactive map and figure 12 a zoomed in picture of the top nodes and associate roads. In these figures it can be seen the critical nodes have shifted further west but still remain associated with Interstate 264.
# Plot of the top nodes associated with a CAT 2 hurricane
map2 <- mapview(CAT2_top_nodes, zcol = "btwn_scale", size = "btwn_scale",
color = "black", lwd = 0.25,
col.regions = brewer.pal(6, "YlOrRd"), alpha = 1, at = btwn_breaks,
layer.name = "Node Betweenness (Scaled by 100,000)") +
mapview(CAT2_streets, zcol = "Road_Type", color = street_color,
lwd = 0.75, layer.name = "Roads by Class") +
mapview(CAT2, lwd = 0.01,
col.regions = "blue", alpha.regions = 0.25,
layer.name = "CAT 2 Storm Surge")
map2
Next, the impact on the transportation network due to storm surge from a category 3 hurricane is examined. Again, one of the first items the comes out is the value of betweenness has decreased by a significant amount (approx. 200,000 for betweenness and 200 for btwn_sclaed) for the top nodes when compared to values for both a category 2 hurricane, which can be seen in table 11. This is likely due to the fact there are now less shortest paths available, and fewer edges and nodes. In table 12, Interstate 264 has become one of the top roads with various local roads, increasing in importance.
# Table of the nodes associated with the CAT3 streets
CAT3_top_nodes %>%
arrange(desc(btwn_scale)) %>%
datatable()
Table 11. Top 70 Nodes - Baseline Transportation Network. This list depicts top 70 nodes after impact from storm surge associated with a CAT 3 hurricane.
# Top Roads in descending order based on Btwn
CAT3_top_roads %>%
arrange(desc(btwn_scale)) %>%
datatable()
Table 12. Roads Associated with Top 70 Nodes. This list depicts the all the roads associated with the top 70 nodes after they have been impacted by inundation from storm surge due to a Category 3 hurricane. This shows that Interstate 264 and various local roads are the most critical roads leading to nodes.
Figures 13 and 14 depict the impact of storm surge on the transportation network, with figure 12 an interactive map and figure 14 a zoomed in picture of the top nodes and associate roads. In these figures it can be seen the critical nodes remain in the western portion of Virginia Beach, as they did with storm surge inundation associated with a category 2 hurricane. With the increase in flooding associated with a category 3 hurricane, fewer roads remain, shifting the importance from nodes associated with primary roads to those associated with local roads. Interstate 264 still remains an important part of the transportation network.
# Plot of the top nodes associated with a CAT 3 hurricane
map3 <- mapview(CAT3_top_nodes, zcol = "btwn_scale", size = "btwn_scale",
color = "black", lwd = 0.25,
col.regions = brewer.pal(6, "YlOrRd"), alpha = 1, at = btwn_breaks,
layer.name = "Node Betweenness (Scaled by 100,000)") +
mapview(CAT3_streets, zcol = "Road_Type", color = street_color,
lwd = 0.75, layer.name = "Roads by Class") +
mapview(CAT3, lwd = 0.01,
col.regions = "green", alpha.regions = 0.25,
layer.name = "CAT 3 Storm Surge")
map3
Finally, we examine the impact of storm surge inundation associated with one of the most sever hurricanes, a category 4 storm. Again, one of the first items the comes out is the value of betweenness has decreased to less than 650,000 for raw values, and 6.5 for scaled, as factor of about 35 from the baseline, as seen in Table 13. At this point, very few roads, and thus nodes and edges remain. Table 14 shows that roads associated with the critical nodes has shifted to two primary roads, Independence Blvd and Haygood Rd, both primary roads. Interstate 264 is no longer associated with the top 70 critical nodes.
# Table of the nodes associated with the CAT4 streets
CAT4_top_nodes %>%
arrange(desc(btwn_scale)) %>%
datatable()
Table 13. Top 70 Nodes - Baseline Transportation Network. This list depicts top 70 nodes after impact from storm surge associated with a CAT 4 hurricane.
# Top Roads in descending order based on Btwn
CAT4_top_roads %>%
arrange(desc(btwn_scale)) %>%
datatable()
Table 14. Roads Associated with Top 70 Nodes. This list depicts the all the roads associated with the top 70 nodes after they have been impacted by inundation from storm surge due to a Category 4 hurricane. Two primary roads, Independence Blvd and Haygood Rd, are the most critical roads leading to nodes.
Examining the impact of storm surge associated with a category 4 hurricane visually and spatially, fromt he interactive map, figure 15, it can be seen all but small portions of Virginia Beach are flooded, with pockets cut off from the rest of the city. The majority of Interstate 264, as are most primary roads. Critical, or important, nodes associated with the transportation network have shifted north of where they were during both category 2 and 3 hurricanes, and are all associated with the same network of connecting roads. Figure 16 shows a zoomed in picture of the most important nodes and associated roads.
# Plot of the top nodes associated with a CAT 4 hurricane
map4 <- mapview(CAT4_top_nodes, zcol = "btwn_scale", size = "btwn_scale",
color = "black", lwd = 0.25,
col.regions = brewer.pal(6, "YlOrRd"), alpha = 1, at = btwn_breaks,
layer.name = "Node Betweenness (Scaled by 100,000)") +
mapview(CAT4_streets, zcol = "Road_Type", color = street_color,
lwd = 0.75, layer.name = "Roads by Class") +
mapview(CAT4, lwd = 0.01,
col.regions = "purple", alpha.regions = 0.25,
layer.name = "CAT 4 Storm Surge")
map4
Walking through the tables and figures associated with the levels of storm surge, from no surge in the baseline to storm surge associated with a category 4 hurricane, the critical nodes of the transportation network shift west and then north. This follows with how the storm surge flows from the coast in the east inland, as well as from the swampy, lower lying areas to the south. At lower categories of storm, primary roads, such as Independence Blvd, Lynnhaven Pkwy, and London Bridge Rd in the vicinity of Interstate 264 are by far the most important. As primary roads, these have the most capacity and access and thus makes sense why they have the highest betweenness values, which is a measure of how many shortest paths route through them, and thus importance. As inundation from storm surge increases, the amount of roads available decreases and thus so does the betweenness value - fewer edges and nodes means less shortest paths to be calculated. Additionally, critical nodes shift west and north, as well as shift from the interstate and primary roads to local roads, which have less capacity. Given the fact that there is an extreme amount of flooding, especially during a category 4 storm, the capacity of the local roads associated with critical nodes is not an issue - there will likely be very few people transiting them during a flooding event, but their capacity may become important after a hurricane during disaster relief efforts.
Working through this project was extremely challenging and enjoyable.
Throughout I learned a great deal about programming in R
and utilizing R Markdown for creation of documents. More
specifically, I was able to dive into a specific package,
tidygraph, and expand my knowledge of not just
transportation network analysis, but also ther concept of graph theory.
This was extremely enlightening and I found graph theory to be
applicable to various types of networks and not just transportation
networks. That said, given the opportunity to start over, I may have
chosen to use an R specifically designed for analyzing
transportation networks, such as r5r. This would have given
me the ability to investigate more about transportation routing vice
just examining critical nodes.
In addition to learning about tidygraph and
transportation network analysis thrrough the lens of graph theory, there
were a few issues with data and coding which I encountered. The first,
and most applicable to my project, is the fact that when “clipping” the
transportation network road height is not taken into account,
specifically in locations where there is an overpass, such as an
interstate, crossing over a lower lying area impacted by storm surge,
such as a road or stream. Since the neither the road vectors nor the
storm surge polygons have height associated with them, when performing a
clipping function, if they intersect, the road will be deleted. This can
be seen in figure 11 below. Here, Interstate 264, the Virginia
Beach-Norfolk Expressway, crosses over Lynnhaven Parkway. During a
category 3 hurricane, Lynnhaven Parkway would be inundate and
impassible. Interstate 264 passes over Lynnhaven Parkway and would not
be flooded, as evidenced by the fact vectors leading to this overpass
remain intact and from personal experience of transiting this roadway.
Because there is no height associated with the vectors or the polygons,
Interstate 264 is clipped here, as well as other locations, and
inadvertently removes a potential route and thus impacts the betweenness
values for all nodes in the network. It is highly
probable had Interstate 264 remained intact, betweenness values would
have been altered.
Another issue encountered associated with clipping relates to the
numbering of nodes during the creation of each
tbl_graph. For the creation of each tbl_graph,
the transportation network is first clipped using the storm surge
polygons and then a tbl_graph is created. During the
creation of the tbl_graph, edges are made
from the remaining roads and nodes are numbered and
associated with the edges. Since the transportation
network loses roads, and thus edges with each level of
storm surge, the counting of edges and
nodes starts at different points. This can be seen in
figures 12 and 13. In figure 12, the intersection of S. Rosemont Road
and Virginia Beach Boulevard is given a nodeID of 2170
during a category 1 hurricane. The same exact intersection is given a
nodeID of 2418 during a category 2 hurricane, as seen
in figure 13. Visually, it is easy to compare the two
nodes to see the impact but one cannot compare via
automated methods in code, which would be required for comparing the
thousands of nodes in a network. When this was discovered, to correct
it, clipping the baseline tbl_graph directly was attempted
but unsuccessful. Another option which may be explored would be to
create the baseline tbl_graph, convert it back to an
sf objects to retain the edge and
node IDs, clip based on category of storm, and then
reconvert the node and edge
sf objects back to a single tbl_graph for each
category of storm before calculating betweenness.
Finally, I discovered that even though packages may perform similar
functions, some packages perform better than others, with better meaning
faster. Two such comparisons are between sf and
rmapshaper and then mapview and
tmap. The first two, sf and
rmapshaper have the ability to manipulate spatial data,
perfoming functions such as clipping and simplifying. After some trial,
it was discovered that rmapshaper performed clipping much
faster than sf. As for plotting data, both
mapview and tmap have similar functionality,
but mapview performs much faster, plotting the same data
3-4 times faster than tmap.
Abenayake, C., Jayasinghe, A., Kalpana, H. N., Wijegunarathna, E. E., & Mahanama, P. K. S. (2022). An innovative approach to assess the impact of urban flooding: Modeling Transportation System Failure due to urban flooding. Applied Geography, 147, 102772. https://doi.org/10.1016/j.apgeog.2022.102772
Chen, A., Yang, C., Kongsomsaksakul, S., & Lee, M. (2006). Network-based Accessibility Measures for Vulnerability Analysis of Degradable Transportation Networks. Networks and Spatial Economics, 7(3), 241-256. https://doi.org/10.1007/s11067-006-9012-5
Contributed Packages. (n.d.). https://cran.r-project.org/
Embl-Ebi. (n.d.). Centrality analysis. Centrality analysis | Network analysis of protein interaction data. https://www.ebi.ac.uk/training/online/courses/network-analysis-of-protein-interaction-data-an-introduction/building-and-analysing-ppins/topological-ppin-analysis/centrality-analysis/#:~:text=Centrality%20gives%20an%20estimation%20on,trying%20to%20find%20drug%20targetsLinks to an external site. Accessed on 10 Jun 2023
Faudree, R. (2003). Graph theory. Encyclopedia of Physical Science and Technology, Third Edition, 7, 15–31. https://doi.org/10.1016/b0-12-227410-5/00296-9
Flood Related Hazards. (n.d.). National Oceanographic and Atmospheric Administration. Retrieved June 4 from https://www.weather.gov/safety/flood-hazards#:~:text=Flooding%20typically%20occurs%20when%20prolonged,as%20a%20levee%20or%20dam.
Lovelace, R., Nowosad, J., & Münchow, J. (2020). Chapter 12. Transportation. In Geocomputation with R (pp. 259–279). essay, CRC Press.
Rodrugue, J.-P., & Ducruet, C. (2023, June 13). The Geography of Transport Networks. https://transportgeography.org/
Taylor, M. A. P. (2008). Critical Transport Infrastructure in Urban Areas: Impacts of Traffic Incidents Assessed Using Accessibility-Based Network Vulnerability Analysis. Growth and Change, 39(4), 593-616. https://doi.org/10.1111/j.1468-2257.2008.00448.x
van der Meer, L., Lovelace, R., & Abad, L. (2019, September 26). Lorena Abad, Robin Lovelace & Lucas van der Meer. R-Spatial. https://r-spatial.org/r/2019/09/26/spatial-networks.html. Accessed on 22 Jun 2023
Zhu, Y.-J., Hu, Y., & Collins, J. M. (2020). Estimating road network accessibility during a hurricane evacuation: A case study of hurricane Irma in Florida. Transportation Research Part D: Transport and Environment, 83. https://doi.org/10.1016/j.trd.2020.102334