gtfs-validator icon indicating copy to clipboard operation
gtfs-validator copied to clipboard

Flex: Update stop schema and add missing_stop_id rule

Open emmambd opened this issue 9 months ago • 1 comments

Describe the problem

In order to support Flex as a part of https://github.com/MobilityData/gtfs-validator/issues/1721, we need to

  1. modify the stop schema so stop_id is no longer a required field
  2. add a new rule for missing_stop_id and checks for ids across stop_id, location_group_id, and locations.id

Proposed solution

  • Test to check that missing_required_field is no longer triggered when stop_id is not provided
  • Add new missing_stop_id rule. Test with no-stop-id-for-trip-t_5735996_b_81516_tn_0.zip I removed the stop_id associated with the trip_id t_5735996_b_81516_tn_0 in stop_times.txt from https://data.trilliumtransit.com/gtfs/islandtransit-wa-us/islandtransit-wa-us--flex-v2-TEST.zip to test this.
  • In depth review of acceptance test results, given the widespread implications of this change
File name Spec language Notice to update or add Validator logic Notice table columns
stops.txt, location_groups.txt, locations.geojson In stops.txt:

stop_id

ID must be unique across all `stops.stop_id`, locations.geojson `id`, and `location_groups.location_group_id` values.

In stop_times.txt:

stop_id **Required** if `stop_times.location_group_id` AND `stop_times.location_id` are NOT defined.
-

New notice to address use case that was previously covered in missing_required_field:

missing_stop_id

ERROR: Generate if there is no stop_id, location_group_id, OR location_id


Description should specify that the producer should add stop_id to stops.txt

lineNumber and tripId

Alternatives you've considered

No response

Additional context

This seems to be the most substantial change to the previous files and requirements of the spec from the new Flex changes. We're curious to hear from consumers about this modification and the work required for them to incorporate this change.

emmambd avatar May 09 '24 17:05 emmambd

Tasks:

  • [ ] Investigate if it's possible to keep the same missing required field notice in case of non-flex feeds

davidgamez avatar May 13 '24 15:05 davidgamez

After further clarification, this change is not required. stop_id is still required in all cases where stops.txt is still provided. The decision to define stops.txt as conditionally required is an ongoing discussion in the spec: https://github.com/google/transit/issues/452

emmambd avatar May 15 '24 02:05 emmambd