Skip to content

Commit

Permalink
Added handling for trucks to Alaska
Browse files Browse the repository at this point in the history
Also fixed reading the coordinates in, see tidyverse/readr#308
  • Loading branch information
gregmacfarlane committed Nov 3, 2015
1 parent a588a57 commit e6694d4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/simfiles/county_to_taz.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ library(foreign)
ie_nodes <- read_csv("data/simfiles/ie_nodes.csv")
counties <- read.dbf("data_raw/shapefiles/cnty2faf.dbf")

faf_coords <- read_csv("data/simfiles/facility_coords.csv", col_types = "cnn")
faf_coords <- read_csv("data/simfiles/facility_coords.csv")

county_coords <- filter(faf_coords, name %in% counties$ANSI_ST_CO)
ie_coords <- filter(faf_coords, name %in% ie_nodes$name)
Expand Down Expand Up @@ -71,7 +71,11 @@ county_coords$taz <- over(
)$MODEL_TAZ

outside_counties <- county_coords %>%
select(name, taz)
select(name, taz) %>%
# fix trucks going to Alaska
mutate(taz = ifelse(substr(name, 1, 2) == "02", 500001, taz))



# Zones inside the Halo ==========
# there are two types of points inside the halo:
Expand Down

0 comments on commit e6694d4

Please sign in to comment.