OneBusAway / onebusaway-gtfs-modules

A Java-based library for reading, writing, and transforming public transit data in the GTFS format, including database support.

Home Page:https://github.com/OneBusAway/onebusaway-gtfs-modules/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fares v2 objects are out of date

EmmaSimon opened this issue · comments

Summary:

Currently trying to load properly formatted Fares v2 data will result in exceptions being thrown. This is happening because the current implementation was done a year ago, before the Fares v2 spec was finalized, and some key breaking changes have been made.

Steps to reproduce:

Attempt to load the MBTA GTFS feed.

Expected behavior:

The feed is loaded successfully

Observed behavior:

Exceptions are thrown due to multiple FareProducts with the same ID existing (which is valid according to the spec).

19:17:54.436 ERROR [main]  (OTPMain.java:60) An uncaught error occurred inside OTP: io error: entityType=org.onebusaway.gtfs.model.FareProduct path=fare_products.txt lineNumber=3
org.onebusaway.csv_entities.exceptions.CsvEntityIOException: io error: entityType=org.onebusaway.gtfs.model.FareProduct path=fare_products.txt lineNumber=3
        at org.onebusaway.csv_entities.CsvEntityReader.readEntities(CsvEntityReader.java:161)
        at org.onebusaway.gtfs.serialization.GtfsReader.readEntities(GtfsReader.java:189)
        at org.onebusaway.csv_entities.CsvEntityReader.readEntities(CsvEntityReader.java:120)
        at org.onebusaway.csv_entities.CsvEntityReader.readEntities(CsvEntityReader.java:115)
        at org.onebusaway.csv_entities.CsvEntityReader.readEntities(CsvEntityReader.java:108)
        at org.opentripplanner.gtfs.graphbuilder.GtfsModule.loadBundle(GtfsModule.java:293)
        at org.opentripplanner.gtfs.graphbuilder.GtfsModule.buildGraph(GtfsModule.java:125)
        at org.opentripplanner.graph_builder.GraphBuilder.run(GraphBuilder.java:175)
        at org.opentripplanner.standalone.OTPMain.startOTPServer(OTPMain.java:141)
        at org.opentripplanner.standalone.OTPMain.main(OTPMain.java:55)
Caused by: org.onebusaway.gtfs.serialization.DuplicateEntityException: duplicate entity id: type=org.onebusaway.gtfs.model.FareProduct id=mbta-ma-us_id=prod_boat_zone_1a|category=null|container=null
        at org.onebusaway.gtfs.serialization.GtfsReader$EntityHandlerImpl.registerAgencyId(GtfsReader.java:397)
        at org.onebusaway.gtfs.serialization.GtfsReader$EntityHandlerImpl.handleEntity(GtfsReader.java:341)
        at org.onebusaway.csv_entities.CsvEntityReader$EntityHandlerImpl.handleEntity(CsvEntityReader.java:225)
        at org.onebusaway.csv_entities.IndividualCsvEntityReader.readEntity(IndividualCsvEntityReader.java:148)
        at org.onebusaway.csv_entities.IndividualCsvEntityReader.handleLine(IndividualCsvEntityReader.java:98)
        at org.onebusaway.csv_entities.CsvEntityReader.readEntities(CsvEntityReader.java:157)
        ... 9 common frames omitted

Platform:

Mac OS Ventura, Java 17.0.7, onebusaway-gtfs-modules 1.4.3