Skip to content

Instantly share code, notes, and snippets.

@dantonnoriega
Created June 27, 2016 23:00
Show Gist options
  • Save dantonnoriega/41be8cb0165a5b536e1e81762c74b1c5 to your computer and use it in GitHub Desktop.
Save dantonnoriega/41be8cb0165a5b536e1e81762c74b1c5 to your computer and use it in GitHub Desktop.
library(gtfsr)
library(magrittr)
library(dplyr)
set_api_key('2ec1ae29-b8c2-4a03-b96e-126d585233f9') # input your API key here
chi_feeds <- get_feedlist() %>%
filter(grepl('chicago', loc_t, ignore.case=TRUE))
cta_url <- chi_feeds$url_d[8] # get the GTFS feed url for CTA
gtfs_obj <- cta_url %>% import_gtfs # THIS TAKES FOREVER
agency <- gtfs_obj$agency_df$agency_name[1] # get agency name
map_gtfs_agency_routes(gtfs_obj) # if no agency, assumes only one agency
map_gtfs_agency_routes(gtfs_obj, agency) # can also be explicit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment