GraphHopper.com | Forum | GitHub | Maps | Blog

Issues setting up GTFS routing


#1

My first time with GTFS routing, so no clue what I’m doing wrong. I use a GTFS file from this site and an Estonian OSM file. I tried to set up the routing according to instructions and got it to build properly, but when I try to set up the routing I get the following problem:

! at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:33)
    at com.graphhopper.reader.gtfs.GtfsStorage.loadGtfsFromFile(GtfsStorage.java:203)
    at com.graphhopper.reader.gtfs.GraphHopperGtfs.createOrLoad(GraphHopperGtfs.java:347)
    at com.graphhopper.http.GraphHopperBundle.runPtGraphHopper(GraphHopperBundle.java:213)
    at com.graphhopper.http.GraphHopperBundle.run(GraphHopperBundle.java:202)
    at com.graphhopper.http.GraphHopperBundle.run(GraphHopperBundle.java:64)
    at io.dropwizard.setup.Bootstrap.run(Bootstrap.java:200)
    at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:42)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
    at io.dropwizard.cli.Cli.run(Cli.java:78)
    at io.dropwizard.Application.run(Application.java:93)
    at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:33)
Caused by: java.lang.NullPointerException
    at com.conveyal.gtfs.GTFSFeed.<init>(GTFSFeed.java:376)
    at com.conveyal.gtfs.GTFSFeed.<init>(GTFSFeed.java:352)
    at com.graphhopper.reader.gtfs.GtfsStorage.loadGtfsFromFile(GtfsStorage.java:198)
    ... 10 more

How should I proceed? Is the file the problem?


#2

Can you tell us the exact command you used to import this? And can you print the full logs - it seems that something is missing from the stacktrace, as it should show something like “Could not construct db from file”


#3

I used these exact commands (of course pointing to my files) from the quick start: https://github.com/graphhopper/graphhopper/blob/master/reader-gtfs/README.md

I can check the full errors later.

Thanks for the quick response :blush:


#4

of course pointing to my files

I meant those files :slight_smile:
To avoid other problems - put them in the current directory and avoid spaces.

Are you using GTFS and an openstreetmap file or just GTFS? Can you try with a different GTFS file too?


#5

Ok. I have an OSM file too and the files are already in the working directory and I tried the following command

java -Xmx8g -Xms8g \

-Dgraphhopper.datareader.file=estonia-latest.osm.pbf
-Dgraphhopper.gtfs.file=gtfs.zip
-Dgraphhopper.graph.flag_encoders=pt
-Dgraphhopper.prepare.ch.weightings=no
-Dgraphhopper.graph.location=./graph-cache
-jar web/target/graphhopper-web-*.jar server config.yml


#6

Thanks - I can reproduce the issue (highly likely something strange in the data) and have created:


#7

Thanks a lot! I’ll check if I can hack my way with the data before it gets fixed.


#8

Yeah, I looked at that file, and agency.txt exists, but is empty.
That’s illegal per the GTFS spec, which requires at least one agency.
Adding a dummy data row to agency.txt with the required fields should fix it.