Routes

Routes are routes.txt entities imported from GTFS, and include the same basic structure and fields, plus some additional metadata and derived information. A route is a collection of trips, where each trip represents scheduled service to stops on a given day and time.

Route geometries

Each route includes a representative geometry based on the most common trip patterns for each direction. Generally, a trip shape is included if it represents at least 10% of all trips in that direction. The first shape in the geometry will be the most common shape in the predominant direction. Full shapes are available when accessing trips.

Route Onestop IDs

Onestop ID values are automatically generated for every route using a geohash of the stop locations visited by this route and the name of the route. Two very similar routes may generate the same Onestop ID value, in which more than one route entry will be returned when searching by Onestop ID.

Route Vehicle Types

Every route in Transitland has a route vehicle type. The list of allowable vehicle types is drawn from the GTFS specification and Google's extended list of route types.

Route type number codes can be used to query the routes REST endpoint with the route_type query parameter and the stops REST endpoint with the served_by_route_type query parameter.

For the extended list of route types, transitland-lib maps those back to a "parent" that is one of the standard set of 0 - 12.

	{Code: 0, Name: "Tram"},
	{Code: 1, Name: "Metro"},
	{Code: 2, Name: "Rail"},
	{Code: 3, Name: "Bus"},
	{Code: 4, Name: "Ferry"},
	{Code: 5, Name: "Cablecar"},
	{Code: 6, Name: "Gondola"},
	{Code: 7, Name: "Funicular"},
	{Code: 11, Name: "Trolleybus"},
	{Code: 12, Name: "Monorail"},

	{Code: 100, Name: "Railway Service", Parent: 2},
	{Code: 101, Name: "High Speed Rail Service", Parent: 2},
	{Code: 102, Name: "Long Distance Trains", Parent: 2},
	{Code: 103, Name: "Inter Regional Rail Service", Parent: 2},
	{Code: 104, Name: "Car Transport Rail Service", Parent: 2},
	{Code: 105, Name: "Sleeper Rail Service", Parent: 2},
	{Code: 106, Name: "Regional Rail Service", Parent: 2},
	{Code: 107, Name: "Tourist Railway Service", Parent: 2},
	{Code: 108, Name: "Rail Shuttle (Within Complex)", Parent: 2},
	{Code: 109, Name: "Suburban Railway", Parent: 2},
	{Code: 110, Name: "Replacement Rail Service", Parent: 2},
	{Code: 111, Name: "Special Rail Service", Parent: 2},
	{Code: 112, Name: "Lorry Transport Rail Service", Parent: 2},
	{Code: 113, Name: "All Rail Services", Parent: 2},
	{Code: 114, Name: "Cross-Country Rail Service", Parent: 2},
	{Code: 115, Name: "Vehicle Transport Rail Service", Parent: 2},
	{Code: 116, Name: "Rack and Pinion Railway", Parent: 2},
	{Code: 117, Name: "Additional Rail Service", Parent: 2},

	{Code: 200, Name: "Coach Service", Parent: 3},
	{Code: 201, Name: "International Coach Service", Parent: 3},
	{Code: 202, Name: "National Coach Service", Parent: 3},
	{Code: 203, Name: "Shuttle Coach Service", Parent: 3},
	{Code: 204, Name: "Regional Coach Service", Parent: 3},
	{Code: 205, Name: "Special Coach Service", Parent: 3},
	{Code: 206, Name: "Sightseeing Coach Service", Parent: 3},
	{Code: 207, Name: "Tourist Coach Service", Parent: 3},
	{Code: 208, Name: "Commuter Coach Service", Parent: 3},
	{Code: 209, Name: "All Coach Services", Parent: 3},

	{Code: 300, Name: "Suburban Railway Service", Parent: 2},

	{Code: 400, Name: "Urban Railway Service", Parent: 1},
	{Code: 401, Name: "Metro Service", Parent: 1},
	{Code: 402, Name: "Underground Service", Parent: 1},
	{Code: 403, Name: "Urban Railway Service", Parent: 1},
	{Code: 404, Name: "All Urban Railway Services", Parent: 1},
	{Code: 405, Name: "Monorail", Parent: 12},

	{Code: 700, Name: "Bus Service", Parent: 3},
	{Code: 701, Name: "Regional Bus Service", Parent: 3},
	{Code: 702, Name: "Express Bus Service", Parent: 3},
	{Code: 703, Name: "Stopping Bus Service", Parent: 3},
	{Code: 704, Name: "Local Bus Service", Parent: 3},
	{Code: 705, Name: "Night Bus Service", Parent: 3},
	{Code: 706, Name: "Post Bus Service", Parent: 3},
	{Code: 707, Name: "Special Needs Bus", Parent: 3},
	{Code: 708, Name: "Mobility Bus Service", Parent: 3},
	{Code: 709, Name: "Mobility Bus for Registered Disabled", Parent: 3},
	{Code: 710, Name: "Sightseeing Bus", Parent: 3},
	{Code: 711, Name: "Shuttle Bus", Parent: 3},
	{Code: 712, Name: "School Bus", Parent: 3},
	{Code: 713, Name: "School and Public Service Bus", Parent: 3},
	{Code: 714, Name: "Rail Replacement Bus Service", Parent: 3},
	{Code: 715, Name: "Demand and Response Bus Service", Parent: 3},
	{Code: 716, Name: "All Bus Services", Parent: 3},
	{Code: 717, Name: "Share Taxi Service", Parent: 3},

	{Code: 800, Name: "Trolleybus Service", Parent: 11},

	{Code: 900, Name: "Tram Service", Parent: 0},
	{Code: 901, Name: "City Tram Service", Parent: 0},
	{Code: 902, Name: "Local Tram Service", Parent: 0},
	{Code: 903, Name: "Regional Tram Service", Parent: 0},
	{Code: 904, Name: "Sightseeing Tram Service", Parent: 0},
	{Code: 905, Name: "Shuttle Tram Service", Parent: 0},
	{Code: 906, Name: "All Tram Services", Parent: 0},
	{Code: 907, Name: "Cable Tram", Parent: 0},

	{Code: 1000, Name: "Water Transport Service", Parent: 4},
	{Code: 1001, Name: "International Car Ferry Service", Parent: 4},
	{Code: 1002, Name: "National Car Ferry Service", Parent: 4},
	{Code: 1003, Name: "Regional Car Ferry Service", Parent: 4},
	{Code: 1004, Name: "Local Car Ferry Service", Parent: 4},
	{Code: 1005, Name: "International Passenger Ferry Service", Parent: 4},
	{Code: 1006, Name: "National Passenger Ferry Service", Parent: 4},
	{Code: 1007, Name: "Regional Passenger Ferry Service", Parent: 4},
	{Code: 1008, Name: "Local Passenger Ferry Service", Parent: 4},
	{Code: 1009, Name: "Post Boat Service", Parent: 4},
	{Code: 1010, Name: "Train Ferry Service", Parent: 4},
	{Code: 1011, Name: "Road-Link Ferry Service", Parent: 4},
	{Code: 1012, Name: "Airport-Link Ferry Service", Parent: 4},
	{Code: 1013, Name: "Car High-Speed Ferry Service", Parent: 4},
	{Code: 1014, Name: "Passenger High-Speed Ferry Service", Parent: 4},
	{Code: 1015, Name: "Sightseeing Boat Service", Parent: 4},
	{Code: 1016, Name: "School Boat", Parent: 4},
	{Code: 1017, Name: "Cable-Drawn Boat Service", Parent: 4},
	{Code: 1018, Name: "River Bus Service", Parent: 4},
	{Code: 1019, Name: "Scheduled Ferry Service", Parent: 4},
	{Code: 1020, Name: "Shuttle Ferry Service", Parent: 4},
	{Code: 1021, Name: "All Water Transport Services", Parent: 4},

	{Code: 1100, Name: "Air Service", Parent: 1700},
	{Code: 1101, Name: "International Air Service", Parent: 1100},
	{Code: 1102, Name: "Domestic Air Service", Parent: 1100},
	{Code: 1103, Name: "Intercontinental Air Service", Parent: 1100},
	{Code: 1104, Name: "Domestic Scheduled Air Service", Parent: 1100},
	{Code: 1105, Name: "Shuttle Air Service", Parent: 1100},
	{Code: 1106, Name: "Intercontinental Charter Air Service", Parent: 1100},
	{Code: 1107, Name: "International Charter Air Service", Parent: 1100},
	{Code: 1108, Name: "Round-Trip Charter Air Service", Parent: 1100},
	{Code: 1109, Name: "Sightseeing Air Service", Parent: 1100},
	{Code: 1110, Name: "Helicopter Air Service", Parent: 1100},
	{Code: 1111, Name: "Domestic Charter Air Service", Parent: 1100},
	{Code: 1112, Name: "Schengen-Area Air Service", Parent: 1100},
	{Code: 1113, Name: "Airship Service", Parent: 1100},
	{Code: 1114, Name: "All Air Services", Parent: 1100},

	{Code: 1200, Name: "Ferry Service", Parent: 4},

	{Code: 1300, Name: "Aerial Lift Service", Parent: 6},
	{Code: 1301, Name: "Telecabin Service", Parent: 6},
	{Code: 1302, Name: "Cable Car Service", Parent: 6},
	{Code: 1303, Name: "Elevator Service", Parent: 6},
	{Code: 1304, Name: "Chair Lift Service", Parent: 6},
	{Code: 1305, Name: "Drag Lift Service", Parent: 6},
	{Code: 1306, Name: "Small Telecabin Service", Parent: 6},
	{Code: 1307, Name: "All Telecabin Services", Parent: 6},

	{Code: 1400, Name: "Funicular Service", Parent: 7},
	{Code: 1401, Name: "Funicular Service", Parent: 7},
	{Code: 1402, Name: "All Funicular Service", Parent: 7},

	{Code: 1500, Name: "Taxi Service", Parent: 1700},
	{Code: 1501, Name: "Communal Taxi Service", Parent: 1500},
	{Code: 1502, Name: "Water Taxi Service", Parent: 1500},
	{Code: 1503, Name: "Rail Taxi Service", Parent: 1500},
	{Code: 1504, Name: "Bike Taxi Service", Parent: 1500},
	{Code: 1505, Name: "Licensed Taxi Service", Parent: 1500},
	{Code: 1506, Name: "Private Hire Service Vehicle", Parent: 1500},
	{Code: 1507, Name: "All Taxi Services", Parent: 1500},

	{Code: 1600, Name: "Self Drive", Parent: 1700},
	{Code: 1601, Name: "Hire Car", Parent: 1600},
	{Code: 1602, Name: "Hire Van", Parent: 1600},
	{Code: 1603, Name: "Hire Motorbike", Parent: 1600},
	{Code: 1604, Name: "Hire Cycle", Parent: 1600},

	{Code: 1700, Name: "Miscellaneous Service", Parent: 3}, // Convert all unknown to Bus
	{Code: 1701, Name: "Cable Car", Parent: 5},
	{Code: 1702, Name: "Horse-drawn Carriage", Parent: 1700},
  

The latest version of this mapping is maintained at https://github.com/interline-io/transitland-lib/blob/master/tl/tt/routetypes.go