Skip to content
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

Parent station in stop_areas.txt causes transit graph build error #6317

Open
ethanpooley opened this issue Dec 8, 2024 · 2 comments
Open

Comments

@ethanpooley
Copy link

ethanpooley commented Dec 8, 2024

Expected behavior

GTFS spec for this file be followed:

If a station (i.e. a stop with stops.location_type=1) is defined in this field, it is assumed that all of its platforms (i.e. all stops with stops.location_type=0 that have this station defined as stops.parent_station) are part of the same area.

Observed behavior

    10:55:33.343 ERROR [main]  (OTPMain.java:61) An uncaught error occurred inside OTP: Expected location_type 0, but got 1 for stops.txt entry <Stop sound-transit_SS02>
    java.lang.IllegalArgumentException: Expected location_type 0, but got 1 for stops.txt entry <Stop sound-transit_SS02>
    	at org.opentripplanner.gtfs.mapping.StopMapper.assertLocationTypeIsStop(StopMapper.java:103)
    	at org.opentripplanner.gtfs.mapping.StopMapper.doMap(StopMapper.java:45)
    	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1228)
    	at org.opentripplanner.gtfs.mapping.StopMapper.map(StopMapper.java:41)
    	at org.opentripplanner.gtfs.mapping.StopAreaMapper.doMap(StopAreaMapper.java:59)
    	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1228)
    	at org.opentripplanner.gtfs.mapping.StopAreaMapper.map(StopAreaMapper.java:49)
    	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    	at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1787)
    	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
    	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
    	at org.opentripplanner.framework.collection.MapUtils.mapToList(MapUtils.java:32)
    	at org.opentripplanner.gtfs.mapping.StopAreaMapper.map(StopAreaMapper.java:44)
    	at org.opentripplanner.gtfs.mapping.GTFSToOtpTransitServiceMapper.mapStopTripAndRouteDataIntoBuilder(GTFSToOtpTransitServiceMapper.java:169)
    	at org.opentripplanner.gtfs.graphbuilder.GtfsModule.buildGraph(GtfsModule.java:142)
    	at org.opentripplanner.graph_builder.GraphBuilder.run(GraphBuilder.java:194)
    	at org.opentripplanner.standalone.OTPMain.startOTPServer(OTPMain.java:144)
    	at org.opentripplanner.standalone.OTPMain.main(OTPMain.java:56)
    10:55:33.349 INFO [server-shutdown-info]  (OtpStartupInfo.java:43) OTP SHUTTING DOWN (version: 2.6.0, ser.ver.id: 157, commit: 155d19bd293e260488fca8b3662788b7e29411eb, branch: master)

If areas.txt and stop_areas.txt are removed from the GTFS, this error no longer occurs.

Version of OTP used (exact commit hash or JAR name)

2.6.0

Data sets in use (links to GTFS and OSM PBF files)

GTFS: Sound Transit (Seattle, WA USA)
OSM: Washingon, USA (Can't host my own file, but this one covers the necessary area)

Command line used to start OTP

java -Xms58g -Xmx58g -jar otp.jar --loadStreet --save ./

Router config and graph build config JSON

otp-config.json

{
      "otpFeatures" : {
        "APIBikeRental" : false,
        "APIServerInfo" : false,
        "APIUpdaterStatus" : true,
        "AsyncGraphQLFetchers" : true,
        "Co2Emissions" : true,
        "FaresV2" : true,
        "FlexRouting" : true,
        "FloatingBike" : true,
        "LegacyRestApi" : true,
        "OptimizeTransfers" : true,
        "ParallelRouting" : true,
        "SandboxAPIParkAndRideApi" : true
      }
}

build-config.json

{
      "embedRouterConfig" : true,
      "fares" : "off",
      "osmCacheDataInMem" : false,
      "osmDefaults" : {
        "timeZone" : "America/Los_Angeles"
      },
      "platformEntriesLinking" : true,
      "staticBikeParkAndRide" : true,
      "staticParkAndRide" : true,
      "transitModelTimeZone" : "America/Los_Angeles",
      "transitServiceStart" : "-P3Y",
      "transitServiceEnd" : "P1Y"
}

router-config.json

{
      "routingDefaults" : {
        "accessEgress" : {
          "maxDuration" : "PT20M"
        },
        "streetRoutingTimeout" : "4s",
        "walk" : {
          "BoardCost" : 600
        }
      },
      "transit" : {
        "searchThreadPoolSize" : 6
      },
      "updaters" : [ {
        "type" : "stop-time-updater",
        "feedId" : "bctransit-comoxvalley",
        "url" : "http://comox.mapstrat.com/current/gtfrealtime_TripUpdates.bin",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "bctransit-kamloops",
        "url" : "http://kamloops.mapstrat.com/current/gtfrealtime_TripUpdates.bin",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "bctransit-kelowna",
        "url" : "http://kelowna.mapstrat.com/current/gtfrealtime_TripUpdates.bin",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "bctransit-squamish",
        "url" : "http://squamish.mapstrat.com/current/gtfrealtime_TripUpdates.bin",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "bctransit-victoria",
        "url" : "http://victoria.mapstrat.com/current/gtfrealtime_TripUpdates.bin",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "bctransit-whistler",
        "url" : "http://whistler.mapstrat.com/current/gtfrealtime_TripUpdates.bin",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "capitolcorridor",
        "url" : "http://api.511.org/transit/tripupdates?api_key=7a527354-24a2-4e51-a470-dc8b5393529b&agency=AM",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "community-transit",
        "url" : "http://s3.amazonaws.com/commtrans-realtime-prod/tripupdates.pb",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "lane-transit-district-tf",
        "url" : "http://feed.ltd.org/gtfs-realtime/tripupdate",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "pullman-transit",
        "url" : "https://pullmanbusbeacon.com/gtfs-rt/tripupdates",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "sacrt",
        "url" : "https://bustime.sacrt.com/gtfsrt/trips",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "soltrans-url",
        "url" : "http://api.511.org/transit/tripupdates?api_key=7a527354-24a2-4e51-a470-dc8b5393529b&agency=ST",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "sonoma-url",
        "url" : "http://api.511.org/transit/tripupdates?api_key=7a527354-24a2-4e51-a470-dc8b5393529b&agency=SO",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "sound-transit",
        "url" : "https://api.pugetsound.onebusaway.org/api/gtfs_realtime/trip-updates-for-agency/40.pb",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "trimet-tf",
        "url" : "http://developer.trimet.org/ws/V1/TripUpdate/?appID=600587740C9C7A5B879C33EA6",
        "frequency" : "PT2M"
      }, {
        "type" : "stop-time-updater",
        "feedId" : "vine-url",
        "url" : "http://api.511.org/transit/tripupdates?api_key=7a527354-24a2-4e51-a470-dc8b5393529b&agency=VN",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "bird-scooter-portland",
        "sourceType" : "gbfs",
        "url" : "https://mds.bird.co/gbfs/portland/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "bird-scooter-sea",
        "sourceType" : "gbfs",
        "url" : "https://mds.bird.co/gbfs/v2/public/seattle-washington/free_bike_status.json",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "lime-scooter-sea",
        "sourceType" : "gbfs",
        "url" : "https://data.lime.bike/api/partners/v1/gbfs/seattle/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "link-scooters-sea",
        "sourceType" : "gbfs",
        "url" : "https://mds.linkyour.city/gbfs/2.2/us_wa_seattle/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "portland-biketown",
        "sourceType" : "gbfs",
        "url" : "https://gbfs.biketownpdx.com/gbfs/en/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "portland-biketown-ebikeshare",
        "sourceType" : "gbfs",
        "url" : "https://gbfs.biketownpdx.com/gbfs/en/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "spin-scooters-portland",
        "sourceType" : "gbfs",
        "url" : "https://web.spin.pm/api/gbfs/v1/portland/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "spin-scooters-san-francisco",
        "sourceType" : "gbfs",
        "url" : "https://gbfs.spin.pm/api/gbfs/v2_3/san_francisco/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "spin-scooters-seattle",
        "sourceType" : "gbfs",
        "url" : "https://web.spin.pm/api/gbfs/v1/seattle/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "veoride-arlington-e-bike",
        "sourceType" : "gbfs",
        "url" : "https://cluster-prod.veoride.com/api/shares/gbfs/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "veoride-arlington-scooter",
        "sourceType" : "gbfs",
        "url" : "https://cluster-prod.veoride.com/api/shares/gbfs/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "veoride-santa-e-bike",
        "sourceType" : "gbfs",
        "url" : "https://cluster-prod.veoride.com/api/shares/gbfs/",
        "frequency" : "PT2M"
      }, {
        "type" : "vehicle-rental",
        "network" : "veoride-santa-monica",
        "sourceType" : "gbfs",
        "url" : "https://cluster-prod.veoride.com/api/shares/gbfs/",
        "frequency" : "PT2M"
      } ]
}

Steps to reproduce the problem

@ethanpooley
Copy link
Author

Hold up on this one, I'm doing some more testing.

@ethanpooley
Copy link
Author

Done. Issue confirmed and updated with information on how to stop the error (if you can do without Area files).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant