-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add R script to pull SLC highway network.
This is intial groundwork for #5.
- Loading branch information
1 parent
f018cac
commit 4fb8b4a
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
output/ | ||
|
||
slc-tscore/MM_NetworkDataset_07272020.gdb/* | ||
slc-tscore/agrc_network.zip |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
library(sf) | ||
library(tidyverse) | ||
library(tigris) | ||
|
||
# This file contains code to download and extract street network data from AGRC, | ||
# and transit data for UTA. | ||
# home working directory is "tscore-utc/scenarios/slc-tscore/" | ||
|
||
# Set up boundaries ======== | ||
scope <- counties("UT", class = "sf") %>% | ||
filter(NAME %in% c("Utah", "Salt Lake", "Davis", "Weber")) %>% | ||
st_transform(4326) | ||
|
||
# Get AGRC Network data ========== | ||
# The Utah AGRC multimodal network database is available at | ||
# https://gis.utah.gov/data/transportation/street-network-analysis/#MultimodalNetwork | ||
# | ||
# For this research we downloaded the information from that file in August 2020. | ||
# The file we downloaded is available on Box, but is not committed to the | ||
# repository for space reasons. This file contains code to download the archived | ||
# AGRC network, extract it. | ||
filegdb <- "MM_NetworkDataset_07272020.gdb" | ||
if(!file.exists(filegdb)) { | ||
zippedgdb <- "agrc_network.zip" | ||
if(!file.exists(zippedgdb)) { | ||
download.file("https://byu.box.com/shared/static/qyjf1of9dau7tyc3rptxc9w4fi08x3d6.zip", | ||
zippedgdb) | ||
} | ||
system2("7z", c("e", zippedgdb, str_c("-o", filegdb)) ) | ||
} | ||
|
||
|