Exception in GraphHopperGtfs.createOrLoad() when passing an osm file

Hi,

When I use GraphHopperGtfs.createOrLoad() with createWalkNetwork set to true and passing an osm file I get the following exception:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at com.graphhopper.storage.RAMIntDataAccess.getInt(RAMIntDataAccess.java:209)
at com.graphhopper.storage.GHNodeAccess.getLatitude(GHNodeAccess.java:70)
at com.graphhopper.storage.index.LocationIndexTree$XFirstSearchCheck.checkAdjacent(LocationIndexTree.java:1002)
at com.graphhopper.util.BreadthFirstSearch.start(BreadthFirstSearch.java:44)
at com.graphhopper.storage.index.LocationIndexTree$2.apply(LocationIndexTree.java:556)
at com.carrotsearch.hppc.IntHashSet.forEach(IntHashSet.java:518)
at com.graphhopper.storage.index.LocationIndexTree.findClosest(LocationIndexTree.java:535)
at com.graphhopper.reader.gtfs.GtfsReader.connectStopsToStreetNetwork(GtfsReader.java:160)
at com.graphhopper.reader.gtfs.GtfsReader.readGraph(GtfsReader.java:152)
at com.graphhopper.reader.gtfs.GraphHopperGtfs.createOrLoad(GraphHopperGtfs.java:346)

Apparently this happens while linking the stops to the underlying road network. I am pretty sure that my osm file covers the area of the GTFS data and the preprocessing of the osm file works fine. Any ideas on how I can track this down?

The last lines of the log file:

2018-07-13 10:35:23,293  INFO OSMReader:187 100 000 (preprocess), osmWayMap:435 518 totalMB:2946, usedMB:1190
2018-07-13 10:35:23,659  INFO OSMReader:247 creating graph. Found nodes (pillar+tower):7 326 884, totalMB:2946, usedMB:1427
2018-07-13 10:36:01,543  INFO OSMReader:268 29 026 611, now parsing ways
2018-07-13 10:36:31,818  INFO OSMReader:275 34 467 070, now parsing relations
2018-07-13 10:36:34,340  INFO OSMReader:915 finished way processing. nodes: 1721660, osmIdMap.size:7327160, osmIdMap:100MB, nodeFlagsMap.size:276, relFlagsMap.size:465958, zeroCounter:272 totalMB:3293, usedMB:806
2018-07-13 10:36:34,342  INFO OSMReader:148 time pass1:63s, pass2:70s, total:134s
2018-07-13 10:36:34,344  INFO PrepareRoutingSubnetworks:74 start finding subnetworks (min:200, min one way:0) totalMB:3293, usedMB:806
2018-07-13 10:36:34,897  INFO PrepareRoutingSubnetworks:85 5428 subnetworks found for pt, totalMB:3293, usedMB:865
2018-07-13 10:36:35,127  INFO PrepareRoutingSubnetworks:90 optimize to remove subnetworks (5428), unvisited-dead-end-nodes (0), maxEdges/node (12)
2018-07-13 10:36:35,552  INFO Entity$Loader:277 Table feed_info was missing but it is not required.
2018-07-13 10:36:35,552  INFO GTFSFeed:163 Feed ID is undefined, pester maintainers to include a feed ID. Using file name Archiv.
2018-07-13 10:36:35,552  INFO Entity$Loader:282 Loading GTFS table agency from agency.txt
2018-07-13 10:36:35,553  INFO Entity$Loader:282 Loading GTFS table calendar from calendar.txt
2018-07-13 10:36:35,554  INFO Entity$Loader:282 Loading GTFS table calendar_dates from calendar_dates.txt
2018-07-13 10:36:35,554  INFO Entity$Loader:277 Table fare_attributes was missing but it is not required.
2018-07-13 10:36:35,554  INFO Entity$Loader:277 Table fare_rules was missing but it is not required.
2018-07-13 10:36:35,555  INFO Entity$Loader:282 Loading GTFS table routes from routes.txt
2018-07-13 10:36:35,581  INFO Entity$Loader:282 Loading GTFS table shapes from shapes.txt
2018-07-13 10:36:36,480  INFO Entity$Loader:282 Loading GTFS table stops from stops.txt
2018-07-13 10:36:36,516  INFO Entity$Loader:282 Loading GTFS table transfers from transfers.txt
2018-07-13 10:36:36,546  INFO Entity$Loader:282 Loading GTFS table trips from trips.txt
2018-07-13 10:36:36,602  INFO Entity$Loader:277 Table frequencies was missing but it is not required.
2018-07-13 10:36:36,602  INFO Entity$Loader:282 Loading GTFS table stop_times from stop_times.txt
2018-07-13 10:36:37,692  INFO GTFSFeed:196 1 errors
2018-07-13 10:36:37,692  INFO GTFSFeed:198 GTFSError: agency line 1, field 'agency_url': Could not parse URL (format should be <scheme>://<authority><path>?<query>#<fragment>).
2018-07-13 10:36:37,692  INFO GTFSFeed:200 Building stop to stop times index
2018-07-13 10:36:38,676  INFO GTFSFeed:203 Building trips per service index
2018-07-13 10:36:38,711  INFO GTFSFeed:205 Building services per date index
2018-07-13 10:36:38,715  INFO Entity$Loader:277 Table fare_attributes was missing but it is not required.
2018-07-13 10:36:38,715  INFO Entity$Loader:277 Table fare_rules was missing but it is not required.
2018-07-13 10:36:40,931  INFO LocationIndexTree:303 location index created in 2.0161536s, size:2 127 949, leafs:244 393, precision:300, depth:4, checksum:1714910, entries:[64, 64, 16, 4], entriesPerLeaf:8.707078

Yeah, this option is there to create a (dummy) street network rather than importing one. It’s not meant for anything serious (rather for debugging), and shouldn’t be combined with an actual road network.

I should probably remove it or prevent it from being combined with a real road network.