Skip to content

Vonter/transit-affinity

Repository files navigation

transit-affinity

Is your area well connected by public transport? Explore the affinity between different areas of a city, based on it's public transport network: https://transit-affinity.urbanuru.in/

Develop

  • Install dependencies with pnpm install (or npm install)
  • Process data with python3 scripts/parse.py <gtfs_dir> <city_code> [<geojson_path>] [<hexagon_resolution>]
  • Start local dev server with pnpm run dev (or npm run dev)
  • Build site deployment assets with pnpm run build (or npm run build)

Architecture

Methodology

GTFS schedule data is parsed for each city, and transit stops are mapped onto a grid of H3 hexagons (and, where boundaries are available, administrative wards). For every pair of areas, an affinity score is computed from the number of daily transit trips that directly connect them, so that areas linked by more frequent direct routes score higher. Connectivity is derived by walking the ordered stop sequence of each trip and counting, for every origin area, the trips that reach each reachable destination area. Scores are color-coded from low (red) to high (green), and the routes connecting any selected pair of areas are surfaced alongside.

Data

The source for the various GTFS datasets used:

License

The code is licensed under MIT. The data is available under ODbL.

AI Declaration

Components of this repository, including code and documentation, were written with assistance from Claude AI.

About

Visualize the public transport network and connectivity between various areas of a city.

Topics

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors