This project is an API that provides transit data.
(Note: include "version=1"
in Accept header for requests)
route_directions/:id/schedule?&service_id
id
: id of route_direction requested
Get aligned rows of stop_times under a service
response = "{",
"id:", integer,
", route_id:", integer,
", direction_id:", ("0" | "1"),
", direction_name:", string,
", service:", service,
", stops_list:", stops_list,
", trips:", trips,
"}" ;
service = "{ name:", string, "}" ;
stops_list = "[", { stop, "," }, stop, "]" ;
stop = "{ id:", integer, ", name:", string, ", local_id:", string, "}" ;
trips = "[ ", { trip, "," }, trip, "]" ;
trip = "{ stop_times: [", { ( integer | null ), "," }, ( integer | null ), "] }" ;
(EBNF)
- Set project root as working directory in CLI after cloning repo.
- Run
$ bundle install
- Run
$ rake db:setup
- Run
$ rake trimet:all
- Run
$ postgres
. - Run
$ rails s
. - Visit
localhost:3000
in web browser. - Open Postman and enter requests at
localhost:3000
.
$ rails new transit_service --api
$ cd transit_service
$ bundle install
$ rails g rspec:install
$ rake db:create
$ rails g migration create_agencies
$ rails g migration create_routes
$ rails g migration create_route_directions
$ rails g migration create_stops
$ rails g migration create_trips
$ rails g migration create_stop_times
$ rails g migration update_trips
$ rails g migration add_indices
$ rails g migration alter_trips
$ rails g migration alter_tables
$ rails g migration add_service_id
$ rails g migration create_services
$ rails g migration add_service_id_index
$ rails g migration create_locations
$ rails g migration update_stops
$ rails g migration create_blocks
$ rails g migration add_location_id_index
$ rake db:migrate
- Ruby/Gems
- Rails
- PostgreSQL
- JSON
- Provide TriMet's WES and MAX schedule data.
- Provide schedule data with trips ordered such that every stop's column in the schedule has ascending arrival time.
- Provide merged schedule data for multiple route_directions, ordered properly.
- Provide routing solutions between WES stations.
- Create Gem for parsing TriMet's GTFS into API's database.
- Provide routing between WES/MAX stations on generic weekday, using Dijkstra's algorithm.
- Manually enter transfer connections, e.g. Pioneer Square, Rose Quarter (TC & Interstate), Gateway TC, Beaverton TC
- Complete API documentation.
- Run
$ rspec
No known bugs.
Please contact patrick7490@icloud.com with questions or concerns.
MIT License
Copyright (c) 2017 Patrick McGreevy