Error: java.lang.IllegalArgumentException: To few matching coordinates (0). Wrong region imported?

Hello GraphHopper users

I am using Geolife trace available from here,

In this dataset the files are with “*.plt” format so to use it with GraphHopper I convert them to gpx

I had also dwonload Beijing.osm.pbf file from OSM website

I have run successfully the example in GraphHopper Github but unfortunatly when I run

./map-matching.sh action=match gpx=./matching-core/src/test/resources/trace.gpx

I got this error

using java
2016-08-15 02:00:17,295 [main] INFO  com.graphhopper.matching.MapMatchingMain - loading graph from cache
2016-08-15 02:00:20,252 [main] INFO  com.graphhopper.matching.MapMatchingMain - Setup lookup index. Accuracy filter is at 40m
2016-08-15 02:00:20,257 [main] INFO  com.graphhopper.matching.MapMatchingMain - Now processing 1 files
2016-08-15 02:00:20,503 [main] ERROR com.graphhopper.matching.MapMatchingMain - Problem with file ./matching-core/src/test/resources/trace.gpx Error: To few matching coordinates (0). Wrong region imported?
java.lang.IllegalArgumentException: To few matching coordinates (0). Wrong region imported?
    at com.graphhopper.matching.MapMatching.doWork(MapMatching.java:156)
    at com.graphhopper.matching.MapMatchingMain.start(MapMatchingMain.java:108)
    at com.graphhopper.matching.MapMatchingMain.main(MapMatchingMain.java:43)
gps import took:0.07630006s, match took: 5.48174E-4

`

I don’t know what is the raison of that problem, my osm file,gpx or what?

I hope I will find a solution to that problem & Thank you in advance

Best regards

Too few points either in the matching file or that matched to the road network. So either your gpx file is wrong or you chose the wrong geographical area (i.e. gpx file is not contained there)

thank you the reply
could you tell me how to make sure that my GPX file is contained to the area I had imported as OSM

I have tested random choosen points in my file and they all belong to Bejing city and the OSM map, I donwload it from http://download.bbbike.org/osm/bbbike/Beijing/
The GPX file I am using, I upload it with google drive in https://drive.google.com/file/d/0BzIpcqeDAvWHMlpfbHpwbnZrelE/view?usp=sharing

Thank you in advance

Best regards

It is the wrong format. You need to include the coordinates as trkpt entries not rtept

Hello again Mr Karussell

I re-convert the “*.plt” file of the dataset I am using and I get the file in this link https://drive.google.com/file/d/0BzIpcqeDAvWHbVdyaUFPMzRfcTQ/view?usp=sharing

But unfornatly I got the same error

I am wondering Mr Karussall if the time struture is the same as the GPX format supported by GraphHopper application, could I confirm that the problem is with OSM file?

I had compared my GPX file with test1.gpx available in GraphHopper and i see diferences in th structure(first part of test1.gpx)

Thank you once again

Best regards

The matching now should run through, at least if you try with the master version and with foot (or is this for car?). The difference is still relative high (>5%) but the track is also very hard to follow manually :wink:

Hello Mr Karussell,

Really how it does work for you?

I did

./map-matching.sh action=import datasource=./map-data/Beijing.osm.pbf vehicle=foot

but I get this error, and is UI server I found just an older test data (of the example from GraphHopper)

using java
2016-08-16 01:26:14,494 [main] INFO  com.graphhopper.matching.MapMatchingMain - Configuration: {action=import, datasource=./map-data/Beijing.osm.pbf, vehicle=foot, prepare.min_network_size=0, prepare.min_one_way_network_size=0, graph.location=./graph-cache, graph.flag_encoders=foot, datareader.file=./map-data/Beijing.osm.pbf}
Exception in thread "main" java.lang.IllegalStateException: Encoding does not match:
Graphhopper config: foot|speed_factor=1.0|speed_bits=4|turn_costs=false|version=2
Graph: car|speed_factor=5.0|speed_bits=5|turn_costs=false|version=1, dir:./graph-cache/
    at com.graphhopper.storage.GraphHopperStorage.loadExisting(GraphHopperStorage.java:259)
    at com.graphhopper.GraphHopper.load(GraphHopper.java:879)
    at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:712)
    at com.graphhopper.matching.MapMatchingMain.start(MapMatchingMain.java:67)
    at com.graphhopper.matching.MapMatchingMain.main(MapMatchingMain.java:43)

I am using the code from https://github.com/graphhopper/map-matching

Really I found problems with this dataset, the file I am using is just one of 15.000 files I need to map-match them all for my project,

Another question Mr Karussel, I am looking for realistic GPS mobility datasets (relativelly large and not taxi traces) for my project so I will map-match them afterward, can you tell me where can I find one of them

Thank you very much

Best regards

remove the graph cache folder before doing the import again

Regarding the GPS datasets you can look into osm traces: Public GPS Traces | OpenStreetMap

hello Mr Karussell

the importation is OK now, thank you

i get this output when I try to match trace3.gpx file

using java
2016-08-16 02:01:47,518 [main] INFO  com.graphhopper.matching.MapMatchingMain - loading graph from cache
2016-08-16 02:01:47,783 [main] INFO  com.graphhopper.matching.MapMatchingMain - Setup lookup index. Accuracy filter is at 40m
2016-08-16 02:01:47,788 [main] INFO  com.graphhopper.matching.MapMatchingMain - Now processing 1 files
2016-08-16 02:01:49,123 [main] ERROR com.graphhopper.matching.MapMatchingMain - Problem with file ./matching-core/src/test/resources/trace3.gpx Error: Sequence is broken for submitted track at 125 of 350 time steps (5813 points). observation:39.961199,116.363739,91.744797064, 1246540331000, candidates: [distance: 50.304227828282876 to 39.96095970185756,116.36423989454448,NaN]
java.lang.RuntimeException: Sequence is broken for submitted track at 125 of 350 time steps (5813 points). observation:39.961199,116.363739,91.744797064, 1246540331000, candidates: [distance: 50.304227828282876 to 39.96095970185756,116.36423989454448,NaN]
    at com.graphhopper.matching.MapMatching.doWork(MapMatching.java:266)
    at com.graphhopper.matching.MapMatchingMain.start(MapMatchingMain.java:108)
    at com.graphhopper.matching.MapMatchingMain.main(MapMatchingMain.java:43)
gps import took:0.39578193s, match took: 0.909168

Thank you for traces, I just looking for validated datasets

Best regards

You can use the web service as it is a bit easier to handle: i.e. start once and match multiple times.

There are two parameter you can/should tweak: the GPS accuracy (gps_accuracy=40) and the maximum nodes (max_visited_nodes=3000). Those parameters you can attach to the URL and e.g. increase the last to 5000 or the first to 100, play around with which combination you get best quality and performance.

Thank you very much Mr Karussell

I follow the step mentionned and it works with gps accuracy 100 and matching is OK with the file attached

My goal with mapmatching is to get the set of road segemnts traversed so and as what you help me in a previous post i did the following

curl -XPOST -H “Content-Type: application/gpx+xml” -d @./matching-core/src/test/resources/trace3.gpx “localhost:8989/match?vehicle=foot&type=json&traversal_keys=true&gps_accuracy=100”>/home/djanahana/Desktop/out_geo_trace

and it works really good

I have one problem left, sicne I have thousand of files to much for the same area I have to ajust the accuracy parameters for each file which is really hard to set for each file of them

Best regards and I appreciate you help and your time every time you respond my questions

I

You should start with a value which corresponds to the real one, maybe you have this somewhere? Or maybe try other values if the difference from measured to snapped length is too high

Hello Mr Karussel

Sorry, I don’t know what is the real value, the dataset provided dosen’t mentionned any information about that value.

Really, I don’t know how to mesure the diference between the snapped and meusured length? the only parameters I have integrated it in the URL of matching process in “accuracy”

Thank you once again

Best regards