-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GTFS-file-merging for area of SanFrancisco fails (entity reference not found for Route with id "01") #107
Comments
This isn't really a bug, but a feature request to work around some "bad" data. Do you have development experience? If so, this should be easily addressable via a Transformation Strategy. Something like: https://github.com/OneBusAway/onebusaway-gtfs-modules/blob/master/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/FeedInfoFromAgencyStrategy.java I can give you some pointers if this is something you want to take on. |
I do have development experience, so I can send you a PR that addresses this. However, my concern is the best way to solve this... I need to at least know these things:
|
Excellent! I welcome a PR on this. My thoughts:
|
Ok... got you. The solutions seems to be a bit tricky though. I tried to use a GtfsTransformStrategy and a GtfsEntityTransformStrategy subclass. Both do not seem to work here. The first approach using GtfsTransformStrategy does not work, since the whole GTFS file is read before such a strategy is applied (so the exception is raised before code in such a subclass gets executed). At the moment I would assume that the best solution would be to modify the csv loading strategy (just like it is done when trimValues is applied). What do you think? Can you give me further insights? |
It looks like maybe BART fixed their GTFS? I wanted to see if I could offer some solutions to the issue above and when I downloaded the GTFS I see that the BART GTFS references route_id 01 in both the routes.txt and trips.txt files. I was able to merge the 3 files successfully. |
@Heidebritta: Thank you.... you are right! That's actually very good news! You can find both files here: http://transitfeeds.com/p/bart/58 So for me this issue lost its importance (at least for now... until I come across the problem in GTFS files from other agencies). |
I really hope that this is the right location for this report. In fact I am using gtfs-transformer-cli to merge multiple GTFS-files. But as I could not find a repo on github for gtfs-transformer-cli this is the best I could find...
Summary:
I am trying to merge GTFS file for the area of San Francisco by BART, Tideline-Water-Taxi and SRTM. I expect that to work but instead I get the following error (with latest SNAPSHOT version 1.3.48):
Steps to reproduce:
Use these files from transitfeed and try to merge them using gtfs-transformer-cli (using argument overwriteDuplicates).
https://transitfeeds.com/p/bart/58/latest/download
https://transitfeeds.com/p/tideline-water-taxi/756/latest/download
https://transitfeeds.com/p/sfmta/60/latest/download
Expected behavior:
That I get a merges gtfs file that contains the information in all the three files listed above.
Observed behavior:
No resulting GTFS file was created. Program exited with an error
Platform:
Fedora 28 on an Intel i7 System (64bit).
JDK used is openjdk version "1.8.0_181"
Version of gtfs-transformer-cli is 1.3.48
Additional information:
I already did some investigations on this issue. The problem seems to be that the GTFS file from BART references routes a bit akward. While in trips.txt the route with id "01" is referenced, in file routes.txt the id is "1" (without the leading zero)... there is no "01". So the error message is quite accurate. The only problem I have is that for transitfeeds the GTFS file is correct (as you might know, they seem to do some validation.. and the affected GTFS file validates without an error) and that if you treat the id as an integer (which to my understanding almost all agencies do) the reference actually should work. Would it make sense to have an auto-correcting mechanism here or to at least provide an argument where ids can be forced as integer values?
Regards,
Niko
The text was updated successfully, but these errors were encountered: