GRoute
GTFS routes.txt file are groups "of trips that are displayed to riders as a single service", there are 10 routes relating to Galway City - one each for 401, 402, 404, 405, 407, 409, 410, 411, 412, 414. Instead GRoutes are based on route_short_name
- direction_id
combinations so there are 20. This means they can also hold information about associated bus stops.
GRoute Schema
Name | Type | Description | From GTFS .txt file |
---|---|---|---|
route_short_name | string | The route name eg. 405 | yes |
route_long_name | string | The route long name (not always accurrate, use route variations first/last stop). | yes |
direction_id | string | The route direction | no |
g_trip_headsign | string | The trip headsign | no |
g_route_variations | array | Contains objects describing route variations - eg. Early morning/Late night trips covering only half of the bus route | no |
g_stops | array | Array of Stops on the route | no |
g_route_ids | array | The route ids (see note) | no |
Note
Bus Éireann's GTFS files use at least two route_id
s to refer to the same routes. eg 10-401-e19-1 and 10-401-e20-1 both refer to the route with route_short_name
401.
This project disregards route_id
s and instead relies on a combination of route_short_name
and direction_id
for all queries. For convenience the long route_id
s are accepted in uris. /api/groutes/10-405-e19-1
will get the same results as /api/groutes/405
GET all GRoutes
Gets all 20 Galway City GRoutes.
Example
Request
/api/groute/
Response
{"results": [{"route_short_name": "401","direction_id": "0","route_long_name": "Parkmore Industrial Estate - Dr Mannix Rd (Rockbarton Rd)","g_trip_headsign": "Parkmore Industrial Estate - Dr Mannix Rd (Rockbarton Rd)","g_route_variations": [{"route_id": "10-401-e19-1","route_short_name": "401","direction_id": "0","first_stop_id": "8460B6355601","last_stop_id": "8460B522301","first_stop_name": "Galway Tech Park, stop 635561","last_stop_name": "Scoil Éinde Boys NS, stop 522301","num_stops": 37},{"route_id": "10-401-e19-1","route_short_name": "401","direction_id": "0","first_stop_id": "8460B6355601","last_stop_id": "8460B522331","first_stop_name": "Galway Tech Park, stop 635561","last_stop_name": "Eyre Square, stop 522331","num_stops": 24}],"g_stops": [{"stop_id": "8460B6355601","stop_name": "Galway Tech Park, stop 635561","stop_lat": 53.29902494788,"stop_lon": -8.98686582677608}// ... 36 more g_stops on route (ordered).],"g_route_ids": ["10-401-e19-1", "10-401-e20-1"]}// ... 19 more g_routes]}
GET GRoutes by routeid, directionid
Params
Name | Required | Description |
---|---|---|
route | false | Accepts route_id or route_short_name |
direction | false | Either '1' or '0'. If not provided the response will include both directions |
Example
Request
/api/groute/401/1
Response
{"results": [{"route_id": "10-401-e19-1","route_short_name": "401","direction_id": "1","g_route_ids": ["10-401-e19-1", "10-401-e20-1"],"route_long_name": "Parkmore Industrial Estate - Dr Mannix Rd (Rockbarton Rd)","g_trip_headsign": "Dr Mannix Rd (Rockbarton Rd) - Parkmore Industrial Estate","g_route_variations": [// ... g_route_variations],"g_stops": [// ... g_stops on route (ordered)]}]}