Skip to content

MokeEire/la28-r

Repository files navigation

LA Olympics Transit Analysis

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.

Overview

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.

Repository Contents

  • /data/ - Contains input and output datasets:

    • Input data:
      • venues.csv - Olympic venue locations with latitude, longitude, and venue information
      • nhgis_population.csv - Population data from NHGIS at census tract level
      • nhgis_census_tracts.shp (and related files) - Geographic boundaries for LA County census tracts
    • Output data:
      • isochrones/ - Generated isochrone files from the TravelTime API
  • /R/ - Contains R scripts for data preparation:

    • prepare-venues-data.R - Prepares and formats the Olympic venues data
    • prepare-isochrones.R - Prepares isochrone data for analysis
    • fct-prep.R - Functions for data preparation and analysis
    • fct-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

Getting Started

Prerequisites

  • R 4.0.0+
  • RStudio (recommended for working with Quarto files)

Because I am using {renv}, installing packages should be handled automatically.

Setup

  1. Clone this repository:
  • Copy the repo URL, start a new Project in RStudio, select the Version Control option and paste the URL
  1. Create a .Renviron file 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
    
  2. Download NHGIS data: NHGIS population/geospatial data can be found at NHGIS, or better yet use their R package

Running the Analysis

  1. 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.

  2. 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.

  3. 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.

Customizing the Analysis

  • To analyze different venues, modify the data/venues.csv file
  • To adjust travel time thresholds, modify the parameters in the traveltimeR function calls in prepare-isochrones.R
  • To change the transit schedule day or time, update the departure_date and departure_time parameters in the traveltimeR API calls

Methodology Notes

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:

  1. Preparing and geocoding venue locations
  2. Generating isochrones using the TravelTime API for multiple time thresholds (15, 30, 45, and 60 minutes)
  3. Spatial joining of isochrones with census tract population data
  4. Calculating accessibility metrics by aggregating population within isochrones
  5. Visualizing results through maps and charts

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • TravelTime API for isochrone generation
  • NHGIS for population data
  • LA Metro for transit schedule data
  • Readme generated by Claude and edited by me

Citation

If you use this code or data in your work, maybe throw me a mention.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages