MobilityData / gtfs-validator

Canonical GTFS Validator project for schedule (static) files.
https://gtfs-validator.mobilitydata.org/
Apache License 2.0
278 stars 100 forks source link

[REQUEST] Implement shape points are sorted #193

Closed maximearmstrong closed 4 years ago

maximearmstrong commented 4 years ago

Is your feature request related to a problem? Please describe. Every points in a shape should be in order. This is a GTFS rule implemented in Google Python validator as AddShapePointObjectUnsorted.

Describe the solution you'd like Actual Google GTFS validator behaviour : verifies if shape point sequence is valid while adding it. Verifies if points are in good order by verifying distance from the beginning of the shape. https://github.com/google/transitfeed/blob/d727e97cb66ac2ca2d699a382ea1d449ee26c2a1/transitfeed/shape.py#L54

Describe alternatives you've considered

Additional context Line 180 in Error support priorities https://docs.google.com/spreadsheets/d/1vqe6wq7ctqk1EhYkgtZ0_TbcQ91vccfs2daSjn20BLE/edit#gid=0

barbeau commented 4 years ago

Note that the actual CSV file contents for any GTFS file aren't guaranteed to be in order by any field.

From a quick look at the Python code linked above, it looks like these rules are all based on first sorting the shapes.txt file by shape_pt_sequence, and then iterating through the records examining the other fields from shapes.txt.

lionel-nj commented 4 years ago

Implemented in https://github.com/MobilityData/gtfs-validator/pull/70