routes.txt
describes all routes in a public transportation network, including route_id
, agency_id
, route_short_name
, route_long_name,route_desc
, route_type
, route_url
, route_color
, route_text_color
. Refer to GTFS reference: routes_fields for the detailed description.
1. route_id and route_short_name
route_id
is not always associated in a one-to-one relationship with route_short_name
. For instance,
mysql> USE paris_gtfs;
mysql> SELECT route_id, route_short_name, route_long_name FROM routes ORDER BY route_short_name LIMIT 10;
+----------+------------------+--------------------------------------------------------------------+
| route_id | route_short_name | route_long_name |
+----------+------------------+--------------------------------------------------------------------+
| 1419799 | "1" | "(CHATEAU DE VINCENNES <-> LA DEFENSE) - Aller" |
| 1419800 | "1" | "(CHATEAU DE VINCENNES <-> LA DEFENSE) - Retour" |
| 1197613 | "10" | "(BOULOGNE - PONT DE SAINT CLOUD <-> GARE D'AUSTERLITZ) - Aller" |
| 1197614 | "10" | "(BOULOGNE - PONT DE SAINT CLOUD <-> GARE D'AUSTERLITZ) - Aller" |
| 1197615 | "10" | "(BOULOGNE - PONT DE SAINT CLOUD <-> GARE D'AUSTERLITZ) - Retour" |
| 1447126 | "101" | "(JOINVILLE LE PONT-RER <-> CHAMPIGNY SUR MARNE-CAMPING) - Aller" |
| 1447127 | "101" | "(JOINVILLE LE PONT-RER <-> CHAMPIGNY SUR MARNE-CAMPING) - Retour" |
| 1447242 | "102" | "(GAMBETTA <-> BOIS-PERRIER-RER - ROSNY 2) - Aller" |
| 1447243 | "102" | "(GAMBETTA <-> BOIS-PERRIER-RER - ROSNY 2) - Retour" |
| 872279 | "103" | "(ECOLE VETERINAIRE DE MAISONS-ALFORT) - Retour" |
+----------+------------------+--------------------------------------------------------------------+
10 rows in set (0,00 sec)
Be aware that route_short_name
appending suffix characters (e.g., s
, ‘soir’ in French) doesn’t guarantee the same route. For instance, 38
and 38s
in Toulouse,
+-------------------+------------------+-------------------------------------------------------+
| route_id | route_short_name | route_long_name |
+-------------------+------------------+-------------------------------------------------------+
| 11821949021891616 | 2 | Cours Dillon / Université Paul Sabatier |
| 11821949023200859 | 2s | Cours Dillon / Université Paul Sabatier |
| 11821949021891619 | 10 | Cours Dillon / Malepère |
| 11821949021891676 | 10s | Cours Dillon / Malepère |
| 11821949021891621 | 12 | Cours Dillon / Basso Cambo |
| 11821949023200862 | 12s | Cours Dillon / Basso Cambo |
| 11821949021891631 | 22 | Marengo SNCF / Gonin |
| 11821949023200864 | 22s | Marengo SNCF / Gonin |
| 11821949021891636 | 38 | Empalot / Amouroux |
| 11821949023200865 | 38s | Cours Dillon / Amouroux |
| 11821949021891673 | 78 | Université Paul Sabatier / St Orens Lycée |
| 11821953316814852 | 78s | Université Paul Sabatier / St Orens Lycée |
| 11821949021891674 | 79 | Ramonville Métro / Labège Couder ou St-Orens Lycée |
| 11821949024202292 | 79s | Université Paul Sabatier / St-Orens Lycée |
| 11821949021891682 | 81 | Université Paul Sabatier / Castanet-Tolosan |
| 11821949023798567 | 81s | Université Paul Sabatier / Castanet-Tolosan |
| 11821949023946608 | 88 | Ramonville Métro / Hôpital Larrey |
| 11821949024037461 | 88s | Université Paul Sabatier / CHR Rangueil |
+-------------------+------------------+-------------------------------------------------------+
Get the approximate number of unique routes by counting the numbe of unique route_short_name
.
mysql> USE gtfs; -- Toulouse GTFS
mysql> SELECT COUNT(DISTINCT route_short_name) FROM routes;
+----------------------------------+
| COUNT(DISTINCT route_short_name) |
+----------------------------------+
| 106 |
+----------------------------------+
1 row in set (0,00 sec)
mysql> USE paris_gtfs; -- Paris GTFS
mysql> SELECT COUNT(DISTINCT route_short_name) FROM routes;
+----------------------------------+
| COUNT(DISTINCT route_short_name) |
+----------------------------------+
| 364 |
+----------------------------------+
1 row in set (0,00 sec)
2. route_type
The route_type
field describes the type of transportation used on a route. Valid values for this field are
- 0 – Tram, Streetcar, Light rail. Any light rail or street level system within a metropolitan area.
- 1 – Subway, Metro. Any underground rail system within a metropolitan area.
- 2 – Rail. Used for intercity or long-distance travel.
- 3 – Bus. Used for short- and long-distance bus routes.
- 4 – Ferry. Used for short- and long-distance boat service.
- 5 – Cable car. Used for street-level cable cars where the cable runs beneath the car.
- 6 – Gondola, Suspended cable car. Typically used for aerial cable cars where the car is suspended from the cable.
- 7 – Funicular. Any rail system designed for steep inclines.
References:
[1]General Transit Feed Specification Reference
微信赞赏
支付宝赞赏