From ba95dcad18cbefc92ab6a05da70c2fea0caca97c Mon Sep 17 00:00:00 2001 From: Tzu-Jen Chan <126435471+tzujenchanmbd@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:12:15 -0400 Subject: [PATCH 1/5] Add networks.txt & route_networks.txt --- gtfs/spec/en/reference.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index d4a5dbdae..1bf0ba31d 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -26,6 +26,8 @@ This document defines the format and structure of the files that comprise a GTFS - [fare\_transfer\_rules.txt](#fare_transfer_rulestxt) - [areas.txt](#areastxt) - [stop_areas.txt](#stop_areastxt) + - [networks.txt](#networkstxt) + - [route_networks.txt](#route_networkstxt) - [shapes.txt](#shapestxt) - [frequencies.txt](#frequenciestxt) - [transfers.txt](#transferstxt) @@ -119,6 +121,8 @@ This specification defines the following files: | [fare_transfer_rules.txt](#fare_transfer_rulestxt) | Optional | Fare rules for transfers between legs of travel.

Along with [fare_leg_rules.txt](#fare_leg_rulestxt), file [fare_transfer_rules.txt](#fare_transfer_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_transfer_rules.txt](#fare_transfer_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [areas.txt](#areastxt) | Optional | Area grouping of locations. | | [stop_areas.txt](#stop_areastxt) | Optional | Rules to assign stops to areas. | +| [networks.txt](#networkstxt) | **Conditionally Forbidden** | Network grouping of routes.

Conditionally Forbidden:
- **Forbidden** if `routes.network_id` field exists.
- Optional otherwise. | +| [route_networks.txt](#route_networkstxt) | **Conditionally Forbidden** | Rules to assign routes to networks.

Conditionally Forbidden:
- **Forbidden** if `routes.network_id` field exists.
- Optional otherwise. | | [shapes.txt](#shapestxt) | Optional | Rules for mapping vehicle travel paths, sometimes referred to as route alignments. | | [frequencies.txt](#frequenciestxt) | Optional | Headway (time between trips) for headway-based service or a compressed representation of fixed-schedule service. | | [transfers.txt](#transferstxt) | Optional | Rules for making connections at transfer points between routes. | @@ -505,6 +509,32 @@ Assigns stops from [stops.txt](#stopstxt) to areas. | `area_id` | Foreign ID referencing `areas.area_id` | **Required** | Identifies an area to which one or multiple `stop_id`s belong. The same `stop_id` may be defined in many `area_id`s. | | `stop_id` | Foreign ID referencing `stops.stop_id` | **Required** | Identifies a stop. If a station (i.e. a stop with `stops.location_type=1`) is defined in this field, it is assumed that all of its platforms (i.e. all stops with `stops.location_type=0` that have this station defined as `stops.parent_station`) are part of the same area. This behavior can be overridden by assigning platforms to other areas. | +### networks.txt + +File: **Conditionally Forbidden** + +Primary key (`network_id`) + +Defines network identifiers that apply for fare leg rules. Forbidden if `routes.network_id` field exists. + +| Field Name | Type | Presence | Description | +| ------ | ------ | ------ | ------ | +| `network_id` | Unique ID | **Required** | Identifies a network. Must be unique in [networks.txt](#networkstxt). | +| `network_name` | Text | **Optional** | The name of the network that apply for fare leg rules, as used by the local agency and its riders. + +### route_networks.txt + +File: **Conditionally Forbidden** + +Primary key (`*`) + +Assigns routes from [routes.txt](#stopstxt) to networks. Forbidden if `routes.network_id` field exists. + +| Field Name | Type | Presence | Description | +| ------ | ------ | ------ | ------ | +| `network_id` | Foreign ID referencing `networks.network_id` | **Required** | Identifies a network to which one or multiple `route_id`s belong. A `route_id` can only be defined in one `network_id`. | +| `route_id` | Foreign ID referencing `routes.route_id` | **Required** | Identifies a route. | + ### shapes.txt File: **Optional** From 6016f23563e9e2c87904e3fa999dd53d62b3686b Mon Sep 17 00:00:00 2001 From: Tzu-Jen Chan <126435471+tzujenchanmbd@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:18:07 -0400 Subject: [PATCH 2/5] Modify presence of routes.network_id Changed to Conditionally Forbidden --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 1bf0ba31d..a8af52b29 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -214,7 +214,7 @@ Primary key (`route_id`) | `route_sort_order` | Non-negative integer | Optional | Orders the routes in a way which is ideal for presentation to customers. Routes with smaller `route_sort_order` values should be displayed first. | | `continuous_pickup` | Enum | Optional | Indicates that the rider can board the transit vehicle at any point along the vehicle’s travel path as described by `shapes.txt`, on every trip of the route. Valid options are:

`0` - Continuous stopping pickup.
`1` or empty - No continuous stopping pickup.
`2` - Must phone agency to arrange continuous stopping pickup.
`3` - Must coordinate with driver to arrange continuous stopping pickup.

Values for `routes.continuous_pickup` may be overridden by defining values in `stop_times.continuous_pickup` for specific `stop_time`s along the route. | | `continuous_drop_off` | Enum | Optional | Indicates that the rider can alight from the transit vehicle at any point along the vehicle’s travel path as described by `shapes.txt`, on every trip of the route. Valid options are:

`0` - Continuous stopping drop off.
`1` or empty - No continuous stopping drop off.
`2` - Must phone agency to arrange continuous stopping drop off.
`3` - Must coordinate with driver to arrange continuous stopping drop off.

Values for `routes.continuous_drop_off` may be overridden by defining values in `stop_times.continuous_drop_off` for specific `stop_time`s along the route. | -| `network_id` | ID | Optional | Identifies a group of routes. Multiple rows in [routes.txt](#routestxt) may have the same `network_id`.| +| `network_id` | ID | **Conditionally Forbidden** | Identifies a group of routes. Multiple rows in [routes.txt](#routestxt) may have the same `network_id`.

Conditionally Forbidden:
- **Forbidden** if `route_networks.txt` file exists.
- Optional otherwise. ### trips.txt From 5bbcd8b44e4a89d04f8e60a7869e7d04ba28c06a Mon Sep 17 00:00:00 2001 From: Tzu-Jen Chan <126435471+tzujenchanmbd@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:29:02 -0400 Subject: [PATCH 3/5] Modify fare_leg_rules.network_id --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index a8af52b29..98a65ca85 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -440,7 +440,7 @@ To process the cost of a leg: | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `leg_group_id` | ID | Optional | Identifies a group of entries in [fare_leg_rules.txt](#fare_leg_rulestxt).

Used to describe fare transfer rules between `fare_transfer_rules.from_leg_group_id` and `fare_transfer_rules.to_leg_group_id`.

Multiple entries in [fare_leg_rules.txt](#fare_leg_rulestxt) may belong to the same `fare_leg_rules.leg_group_id`.

The same entry in [fare_leg_rules.txt](#fare_leg_rulestxt) (not including `fare_leg_rules.leg_group_id`) must not belong to multiple `fare_leg_rules.leg_group_id`.| -| `network_id` | Foreign ID referencing `routes.network_id` | Optional | Identifies a route network that applies for the fare leg rule.

If there are no matching `fare_leg_rules.network_id` values to the `network_id` being filtered, empty `fare_leg_rules.network_id` will be matched by default.

An empty entry in `fare_leg_rules.network_id` corresponds to all networks defined in `routes.txt` excluding the ones listed under `fare_leg_rules.network_id` | +| `network_id` | Foreign ID referencing `routes.network_id` or `networks.network_id`| Optional | Identifies a route network that applies for the fare leg rule.

If there are no matching `fare_leg_rules.network_id` values to the `network_id` being filtered, empty `fare_leg_rules.network_id` will be matched by default.

An empty entry in `fare_leg_rules.network_id` corresponds to all networks defined in `routes.txt` or `networks.txt` excluding the ones listed under `fare_leg_rules.network_id` | | `from_area_id` | Foreign ID referencing `areas.area_id` | Optional | Identifies a departure area.

If there are no matching `fare_leg_rules.from_area_id` values to the `area_id` being filtered, empty `fare_leg_rules.from_area_id` will be matched by default.

An empty entry in `fare_leg_rules.from_area_id` corresponds to all areas defined in `areas.area_id` excluding the ones listed under `fare_leg_rules.from_area_id` | | `to_area_id` | Foreign ID referencing `areas.area_id` | Optional | Identifies an arrival area.

If there are no matching `fare_leg_rules.to_area_id` values to the `area_id` being filtered, empty `fare_leg_rules.to_area_id` will be matched by default.

An empty entry in `fare_leg_rules.to_area_id` corresponds to all areas defined in `areas.area_id` excluding the ones listed under `fare_leg_rules.to_area_id` | | `from_timeframe_group_id` | Foreign ID referencing `timeframes.timeframe_group_id` | Optional | Defines the timeframe for the fare validation event at the start of the fare leg.

The “start time” of the fare leg is the time at which the event is scheduled to occur. For example, the time could be the scheduled departure time of a bus at the start of a fare leg where the rider boards and validates their fare. For the rule matching semantics below, the start time is computed in local time, as determined by [Local Time Semantics](#localtimesemantics) of [timeframes.txt](#timeframestxt). The stop or station of the fare leg’s departure event should be used for timezone resolution, where appropriate.

For a fare leg rule that specifies a `from_timeframe_group_id`, that rule will match a particular leg if there exists at least one record in `timeframes.txt` where all of the following conditions are true
- The value of `timeframe_group_id` is equal to the `from_timeframe_group_id` value.
- The set of days identified by the record’s `service_id` contains the “current day” of the fare leg’s start time.
- The “time-of-day” of the fare leg's start time is greater than or equal to the record’s `timeframes.start_time` value and less than the `timeframes.end_time` value.

An empty `fare_leg_rules.from_timeframe_group_id` indicates that the start time of the leg does not affect the matching of this rule. | From 8664074722f24a373ce3fb0639a3d26798f4188d Mon Sep 17 00:00:00 2001 From: Tzu-Jen Chan <126435471+tzujenchanmbd@users.noreply.github.com> Date: Tue, 21 Nov 2023 13:39:44 -0500 Subject: [PATCH 4/5] Modify primary key of route_networks.txt --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 98a65ca85..0db2a46cf 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -526,7 +526,7 @@ Defines network identifiers that apply for fare leg rules. Forbidden if `routes. File: **Conditionally Forbidden** -Primary key (`*`) +Primary key (`route_id`) Assigns routes from [routes.txt](#stopstxt) to networks. Forbidden if `routes.network_id` field exists. From f1919235af5b6cf641d2efff15f4a4696d6d98b4 Mon Sep 17 00:00:00 2001 From: Tzu-Jen Chan <126435471+tzujenchanmbd@users.noreply.github.com> Date: Wed, 22 Nov 2023 09:09:49 -0500 Subject: [PATCH 5/5] Revise link --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 0db2a46cf..a5b174174 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -528,7 +528,7 @@ File: **Conditionally Forbidden** Primary key (`route_id`) -Assigns routes from [routes.txt](#stopstxt) to networks. Forbidden if `routes.network_id` field exists. +Assigns routes from [routes.txt](#routestxt) to networks. Forbidden if `routes.network_id` field exists. | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ |