opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.22k stars 1.03k forks source link

More informative error messages surrounding how macOS & safari handles .zip files #6167

Open ttalVlatt opened 1 month ago

ttalVlatt commented 1 month ago

I realize I am in the minority using macOS for this kind of work, but, I think this small tweak in how OTP searches for files could save a lot of newcomers to OTP headaches

Issue

macOS, particularly if you use safari, tries to be user friendly in the way it handles zip files, but this can easily lead you to an issue with OTP.

For example, if I download this file from mobility database, safari will automatically unzip the contents into a normal (unzipped) folder mdb-206-202402080055, I never see mdb-206-202402080055.zip.

However, it's common practice to store gtfs files as zip folders, so naturally, I recompress the folder before putting in my graphs folder.

Even if I manually unzip a .zip folder, say to check calendar.txt, macOS tries to be helpful and creates a folder to store the files. If I did the same on windows, the .txt files would simply be spat out into the directory I was in.

I, after a long time struggling, realize the issue here is that due to fact macOS creates this folder, there's now an extra layer my-gtfs-file.zip/my-gtfs-file/agency.txt.

Requested Feature

The error message you get in this case is "missing required entity agency.txt". This made me (and chatGPT) think there was something wrong with the agency.txt file, but the reality was it was just hidden a layer down.

I wonder if there could be a way to have OTP do either of the following

System Info

macOS Sonoma 14.2.1 OTP version 2.2 Using through the opentripplanner R package

leonardehrenfried commented 1 month ago

I'm sympathetic to this request: this error message is very confusing and leading you down the wrong path.

It would be a good idea to improve the error message and the best place would probably be the GTFS reading library, onebusaway-gtfs-modules.

optionsome commented 1 month ago

Should this issue be moved to the OBA repository?