Skip to content

Commit

Permalink
Add R script to pull SLC highway network.
Browse files Browse the repository at this point in the history
This is intial groundwork for #5.
  • Loading branch information
gregmacfarlane committed Dec 9, 2020
1 parent f018cac commit 4fb8b4a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
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
32 changes: 32 additions & 0 deletions slc-tscore/R/agrc_network_export.R
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)) )
}


0 comments on commit 4fb8b4a

Please sign in to comment.