gtfs-validator
gtfs-validator copied to clipboard
[REQUEST] Implement shapes exists for a trip verification (GTFS rule)
Is your feature request related to a problem? Please describe. A trip should be related to an existing shape. The related shape must have a non null length. This is a GTFS rule implemented in Google Python validator and featured in Google Type Error as TYPE_TRIP_WITH_SHAPE_DIST_TRAVELED_BUT_NO_SHAPE and TYPE_TRIP_WITH_SHAPE_DIST_TRAVELED_BUT_NO_SHAPE_DISTANCES
Describe the solution you'd like Actual Google GTFS validator behaviour : verifies if shape id exists in shapes list. See comment below for logic.
Generate WARNING called trip_with_shape_dist_traveled_but_no_shape
Describe alternatives you've considered
Additional context Line 143 and 144 in Error support priorities https://docs.google.com/spreadsheets/d/1vqe6wq7ctqk1EhYkgtZ0_TbcQ91vccfs2daSjn20BLE/edit#gid=0
To clarify, this rule is actually conditional across a few tables, starting with stop_times.txt shape_dist_traveled
- if shape_dist_traveled
exists for a trip in stop_times.txt, then for that trip_id
the file trips.txt
field shape_id
must be populated, and shapes.txt must contain records for that shape_id
.
@timMillet @barbeau Is it guarantied that field shape_dist_traveled
is expressed in km in all GTFS datasets?
Or does it variate amongst data provider (feet vs meter vs kilometers)?
I found an example from the specification using kilometers
:
http://gtfs.org/reference/static#stop_timestxt:
Example: If a bus travels a distance of 5.25 kilometers from the start of the shape to the stop,shape_dist_traveled=5.25.
--
No, units for shape_dist_traveled
can vary - no official unit is provided. Only that the distance units have to match stop_times.txt.
It looks like this issue wasn't fully resolved: the unused shape notice checks if there's a shape_id
in shapes.txt that isn't used in trips.txt
, but it doesn't check if there's a shape_dist_traveled
value in stop_times.txt
that doesn't have a shape_id
in both trips.txt
and shapes.txt
.