This repository contains code and data for generating isochrones using the TravelTime API via {traveltimeR} and analyzing these isochrones with population data. The analysis combines manually collected data on Olympic venue locations with isochrones created using the TravelTime API and population data from NHGIS to evaluate transit accessibility throughout Los Angeles County.
The 2028 Los Angeles Olympics has been promised as a "transit-first" or "car-free" Games, presenting significant challenges and opportunities for a city known for its car culture. This analysis examines how accessible Olympic venues are via public transit and identifies areas where improvements may be needed before 2028.
-
/data/- Contains input and output datasets:- Input data:
venues.csv- Olympic venue locations with latitude, longitude, and venue informationnhgis_population.csv- Population data from NHGIS at census tract levelnhgis_census_tracts.shp(and related files) - Geographic boundaries for LA County census tracts
- Output data:
isochrones/- Generated isochrone files from the TravelTime API
- Input data:
-
/R/- Contains R scripts for data preparation:prepare-venues-data.R- Prepares and formats the Olympic venues dataprepare-isochrones.R- Prepares isochrone data for analysisfct-prep.R- Functions for data preparation and analysisfct-traveltime.R- Functions for querying the TravelTime API
-
MakingIsochrones.qmd- Quarto markdown file that documents the process of querying the TravelTime API and combining isochrones with venue and population data
- R 4.0.0+
- RStudio (recommended for working with Quarto files)
Because I am using {renv}, installing packages should be handled automatically.
- Clone this repository:
- Copy the repo URL, start a new Project in RStudio, select the Version Control option and paste the URL
-
Create a
.Renvironfile in the root directory with your TravelTime API credentials. You can use `usethis::edit_r_environ()``:TRAVELTIME_KEY=your_api_key TRAVELTIME_ID=your_app_id -
Download NHGIS data: NHGIS population/geospatial data can be found at NHGIS, or better yet use their R package
-
Run the venue data preparation script:
source("R/prepare-venues-data.R")This script processes the Olympic venue data and prepares it for the isochrone generation.
-
Run the isochrone preparation script:
source("R/prepare-isochrones.R")This script connects to the TravelTime API to generate transit isochrones for each venue location.
-
Open the Quarto document to see the analysis process: This document walks through the process of querying the API, combining isochrones with venue data, and analyzing population coverage within different travel time thresholds.
- To analyze different venues, modify the
data/venues.csvfile - To adjust travel time thresholds, modify the parameters in the
traveltimeRfunction calls inprepare-isochrones.R - To change the transit schedule day or time, update the
departure_dateanddeparture_timeparameters in thetraveltimeRAPI calls
This analysis uses the TravelTime API to generate isochrones (time-based travel areas) for taking transit and driving to Olympic venues. It then overlays these isochrones with population data to determine how many residents can reach venues within specific time frames.
The analysis process includes:
- Preparing and geocoding venue locations
- Generating isochrones using the TravelTime API for multiple time thresholds (15, 30, 45, and 60 minutes)
- Spatial joining of isochrones with census tract population data
- Calculating accessibility metrics by aggregating population within isochrones
- Visualizing results through maps and charts
This project is licensed under the MIT License - see the LICENSE file for details.
- TravelTime API for isochrone generation
- NHGIS for population data
- LA Metro for transit schedule data
- Readme generated by Claude and edited by me
If you use this code or data in your work, maybe throw me a mention.