I have a taxi dataset which contains a trace of mobility of drivers, an example of a trajectory is found in the file attachednew_oilrag.txt (30.7 KB)
I had parsed it to present the essential parts for my project out_new_oilrag.txt (32.0 KB)
my question is what is the suitable tool to use so it convert my file to supported GPX format for map matching
is their any additional parsing steps to apply before conversion to GPX?
I am asking this question, since I have always face the problem of few corrdinate
This case should be doable as the distance is not that far, but in general this can make problems and you could try to preprocess the data and split them or wait for the following PR being merged: https://github.com/graphhopper/map-matching/pull/87
Another problem can be if there is a too huge gap like e.g. here, of 8 minutes
in lieu of the above PR, the map matching will still run over large separations, though you may need to set the maximum number of points visited to be quite large. Whether it is meaningful to do so is up to you.
thank you for the explanation,
I would like to know what is the maximum gap allowed(permitted).
I have tried to split my dataset into files and if I set a small difeernce in time(50second) I get a big number of small files with few points --> risque of âToo few coordiante problemâ and even when I set 20 minutes as gap between two successive points I get files but with also few coordinates problem with this file out_0new_ifeshce.txt.txt (2.5 KB). I really donât know what to do ? The dataset I am using is a realistic dataset of Sanfransisco taxi cab http://crawdad.org/epfl/mobility/20090224/
Thank you in advance
If youâre using master, then see https://github.com/graphhopper/map-matching/blob/master/matching-core/src/main/java/com/graphhopper/matching/MapMatching.java#L170-L173 - i.e. the only way this should happen is if you provide a GPX list with less than two entries. If youâre not using master, it may be associated with the filtering - points are only used which differ by measurementErrorSigma. It looks like the points in your file are all very âcloseâ, and hence would probably be filtered down to a single point. You can either fix this (as suggested above), or manually detect these errors - it may be fair to assume that the point is stationary (within measurementErrorSigma).
I see that is defined as measurementErrorSigma = 50.0;
What is the measurement unit used so I will find 1) the stay points(distance between successive GPS points are less then measurementErrorSigma and time is less then a threshold) 2) split the trajectory according to stay Points found
I had also check my GPX file and comprae it with one of the test GPX files in Graphhooper , I had found that the stucture of those file is the following
rtept lat="51.374982" lon="12.344148"><desc>turn left onto B 6</desc><extensions><gh:distance>57.5</gh:distance><gh:time>4599</gh:time><gh:direction>E</gh:direction><gh:azimuth>75</gh:azimuth></extensions></rtept>
not worry about this at all (as above, thereâs no need to split your files)
split your files (even though not needed) and manually handle too-few-coordinate cases. This will be equivalent to what youâre proposing (in which youâll then have to manually handle single stationary points anyway).
split your file (even though not needed) and manually handle âstationary pointsâ (even though not needed), but use Graphhopper distance calculations instead of your one e.g. as in the filtering used
Thank you once again for the reply and the explanation
the challenge I am facing is that I have to map match many hundred of files in the dataset and then extract the set of edges ID traversed, thus manual filtering will be a hard task.
I have used the distance function in graphhopper defined as follow, and the result is quit different from the one I used before distance=53.0 VS 52.684626566411(with calcDist)
public static double calcDist(double fromLat, double fromLon, double toLat, double toLon) {
double dLat = toRadians(toLat - fromLat);
double dLon = toRadians(toLon - fromLon);
// use mean latitude as reference point for delta_lon
double tmp = cos(toRadians((fromLat + toLat) / 2)) * dLon;
double normedDist = dLat * dLat + tmp * tmp;
double R = 6372.797560856*1000;
return R * sqrt(normedDist);
}
I add the value of radius R
I see the function âfilterGPXEntriesâ is available only in master and not in 0.8 I am using. unfortunately I faced problems before with master, therefore, I jumped to 0.8.
Thank you very much for your time and help, I really appreciate, I have to map-match the dataset for my PhD project.
Iâve already made my recommendation a few times, and no sense repeating it.
Regarding distances - the GH one is most likely to be correct (depending on which you need). That said, a difference of 0.3m is much likely to be less than the accuracy of your coordinates, and if thatâs the case, itâs not material.
Regarding 0.8 - filterGPXEntries is really just here. Since itâs for your PhD, itâs probably worthwhile looking around the code to understand what itâs doing.
hello again Graphhopper developpers
I split my file with definition of stay points, and I have also change the dataset with another realistc dataset
but, unfortunately, I get problems:ofjava.lang.IllegalStateException: Time difference between subsequent location measurements must be >= 0.
and when I ommit some points I get java.lang.IllegalStateException: No edge matches found for path. Too short? Sequence size 31
Here is my file, IAOK2.txt (134.0 KB)
Thank in advance
Look at the timestamps - the first error seems to be correct. I canât verify the second error without knowing the data set you ran it with - though it appears something may be fundamentally wrong with your data set.
Yes Mr @kodonnell, the timestamps arenât well established, I didnât remark(notice) this. This is due to the fact that the data are from multiple users in the same data file.iaok3.txt (5.7 KB)
this is attached file for example report the second error
I would like also to know how did you discover the previous error, is their any log file of the error or it is the jdk log file for example?
thank you
the data are from multiple users in the same data file
map-matching wonât be able to handle this (reasonably) - how is it to know that two points are from different devices and not to be connected? The input for map-matching should be a single GPX track (unless you know that itâs OK to abuse it etc.). In reality, youâre going to want to split it into separate tracks.
I would like also to know how did you discover the previous error, is their any log file of the error or it is the jdk log file for example?
The error java.lang.IllegalStateException: Time difference between subsequent location measurements must be >= 0 explains pretty clearly what the problem is, and I found the example using python.
Yes exactly,I will separate trajectories of different users.
than you for the explanation.
Excuse me but, did you know the reason of my second error, I attached the file with the problem in my last post
No - at this stage Iâll leave the debugging to you. It could be a bug (as itâs not meant to happen), though itâd pay to test it hasnât been fixed on master first.