Skip to content

Instantly share code, notes, and snippets.

@lovasoa
Last active May 12, 2021 19:39
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lovasoa/8591217 to your computer and use it in GitHub Desktop.
Save lovasoa/8591217 to your computer and use it in GitHub Desktop.
GTFS: Select stops with associated routes (works on a database build from gtfs files, one table per file) https://developers.google.com/transit/gtfs/reference)
SELECT DISTINCT stops.stop_name, routes.route_long_name from stops
INNER join stop_times on stop_times.stop_id=stops.stop_id
INNER join trips on trips.trip_id=stop_times.trip_id
INNER join routes on routes.route_id=trips.route_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment