How to average GPS data?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I have multiple tracklogs (gps data - latitude and longitidue) that I would like to average to create an average track. Note the number of points and the instance in time when they were created are nominally different. Somehow the averaging algorithm needs to take this into account.
Is there a way to average the coordinate data to extract the 'average track'?
Regards, Brad
0 Commenti
Risposte (2)
Star Strider
il 19 Gen 2015
Modificato: Star Strider
il 19 Gen 2015
First, I assume they’re all for the same (or closely similar) track, but on different days. If they’re not, none of the rest of this applies.
I would begin by normalising all the distances and times to start at zero for each track record. Then use interp1 to put all of them on the same sampling times. (Use linspace to create the sampling times vector.) You have to decide whether the interpolated samples are based on time or on distance. You will also have to decide how to deal with records of differing lengths.
If they’re all the same distance, I would interpolate to get different time increments. That might be easiest.
I’m not certain there is any ‘correct’ way to do what you want, so you will have to experiment.
2 Commenti
Star Strider
il 19 Gen 2015
My pleasure.
I would use 'linear', not 'pchip'. The 'linear' method assumes essentially nothing. A non-linear method assumes a non-linearity that may not actually exist.
Normalising your data by some sort of uniform sampling is unfortuantely necessary if you’re going to make any sense of it.
I don’t understand the problems you’re having with your data, so I can only make an educated guess. You may have to find a way to deal with identical independent (interpolating) variables. The usual way is to add a small value, say integral multiples of 1E-8, to any succeeding identical values to make them monotonically increasing. So if you stopped in your track and have several identical position values, and position is your independent variable, you will need to make them non-identical.
I am not aware of an existing algorithm that will do what you want. I would start by searching the File Exchange. The Mapping Toolbox may have such a function (or one that can be adapted to your needs), but I don’t have it so I don’t know. Another possibility is to visit one of the GPS manufacturer sites (for instance Garmin), and see if there are any user contributions in MATLAB that you can use. MATLAB is so ubiquitous that I would be surprised if there isn’t a routine somewhere to do what you want. A ‘DuckDuckGo’ web search (that I assume you’ve already done) is yet another option.
I assume you already tried plotting your data, so you can see if there is anything anomalous with it. When I did this with some of my GPS data (tracing several instances of the same walk to, around, and from a lake near where I once lived), I used plot3 to visualise it, with the position information on the x and y axes, and time on the z axis. I was also interested in elevation data, so I simply wanted to visualise them and not process them.
At this point, I can only wish you good luck! I’m not sure that I can help further, assuming I’ve helped at all.
Chad Greene
il 19 Gen 2015
Perhaps you can pick one track as a first-guess at a centerline and use xy2sn to get relative along-track and cross-track components of all the data, then use a simple least-squares fit to get the best fit line (cross-track as a function of along-track).
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!