geofabrik / OpenRailRouting

routing on railway tracks using OpenStreetMap data and the GraphHopper routing engine
Apache License 2.0
168 stars 30 forks source link

--gpx-location with wildcard does not work #13

Closed arsenm closed 5 years ago

arsenm commented 5 years ago

Using a wildcard seems to not work at all. Each matching file isn't handled individually, and instead an empty result file "*.gpx.res.gpx" is produced after erroring.

$ java -Xmx2500m -Xms50m \
     -Dgraphhopper.prepare.ch.weightings=no \
     -Dgraphhopper.datareader.file="$OSMFILE" \
     -Dgraphhopper.graph.location="$GRAPH_CACHE"\
     -jar target/railway_routing-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
     match --vehicle=alltracks --gpx-location=/tmp/samples/*.gpx $CONFIG_FILE
sample3.gpx
sample2.gpx
sample1.gpx
not_a_match
finished walking
/tmp/samples/*.gpx
    matches:    760
    gpx length: 2890607.408276032 vs 1286177.5047856877
    gpx time:   180434.0 vs 54403.23
    export results to:/tmp/samples/*.gpx.res.gpx
/tmp/samples/*.gpx
    matches:    0
    gpx length: 768085.0628084283 vs 0.0
    gpx time:   42424.0 vs 0.0
    export results to:/tmp/samples/*.gpx.res.gpx
java.lang.RuntimeException: You cannot call getInstructions if response contains errors. Check this with ghResponse.hasErrors(). Errors are: [com.graphhopper.util.exceptions.ConnectionNotFoundException: Connection between locations not found]
    at com.graphhopper.PathWrapper.check(PathWrapper.java:281)
    at com.graphhopper.PathWrapper.getInstructions(PathWrapper.java:224)
    at de.geofabrik.railway_routing.http.RailwayMatchCommand.run(RailwayMatchCommand.java:151)
    at de.geofabrik.railway_routing.http.RailwayMatchCommand.run(RailwayMatchCommand.java:46)
    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 de.geofabrik.railway_routing.http.RailwayRoutingApplication.main(RailwayRoutingApplication.java:34)
 $ ls /tmp/samples 
*.gpx.res.gpx not_a_match   sample1.gpx   sample2.gpx   sample3.gpx
$ cat /tmp/samples/\*.gpx.res.gpx 
$