conveyal / gtfs-lib

A library for loading and saving GTFS feeds of arbitrary size with disk-backed storage
BSD 2-Clause "Simplified" License
71 stars 38 forks source link

Better shape validation #130

Open landonreed opened 6 years ago

landonreed commented 6 years ago

Recently some shapes created in the Data Tools editor were discarded during graph building by OTP. To give Data Tools users a sense for when this might happen to their GTFS feeds, I think we should add some functionality similar to the GTFSPatternHopFactory#isValid method.

cc @abyrd

abyrd commented 6 years ago

Should the editor even be capable of creating invalid shapes? What was wrong with the shapes it produced which caused them to be rejected by OTP?

I agree we want to sanity check inputs an outputs as much as possible. My main concern would be maintaining duplicate code - is it possible to design these checks such that they can be reused in GTFS-lib and other projects?