04-26-2011 04:25 AM - edited 04-26-2011 04:28 AM
Hello,
When using the LocationListener, I get lat/lng coords that vary slightly, sometimes greatly,
when the device is stationary, especially with low intervals.
What are the best practices/techniques to make sense of this data? Should I just pick an
arbitrary fix at the interval I require? Or should I somehow average the coordinates?
Thanks
04-26-2011 05:26 AM
you may use Criteria object to deal with gps fix:
also this one:
04-26-2011 05:30 AM
I'm familiar with these documents, thanks. They do not address my question.
Regardless of the criteria, there is a certain amount of "jitter" between fixes,
even when not moving. My question is how to deal with this when calculating
a stationary fix.
04-26-2011 05:47 AM
personally what I do in my locationUpdated method:
public void locationUpdated(LocationProvider provider, Location location) {
try {
if (location.isValid()) {
satellites = Double
.valueOf(
getNextToken(location
.getExtraInfo("application/X-jsr179-location-nmea" ))[7])
.intValue();
if (satellites > 0) {
QualifiedCoordinates c = location.getQualifiedCoordinates();
currentLongitude = c.getLongitude();
currentLatitude = c.getLatitude();
}
} else {
notifySateliteListener(0);
}
} catch (Exception e) {
e.printStackTrace();
}
}
So I presume I use just basic stuff: checking if location is valid and getting qualified coordinates. Are you doing in similar way?
04-26-2011 08:22 PM
In my experience, jitter is common and to be expected, you do need to deal with the problem of dud values in the data supplied.
I would ignore any results that have fewer than 4 satellites, I have even seen significant jitter with 4 and sometimes 5 satellites but locations with 6 satellites seem pretty solid.
One approach if you can't wait for a reading with 6 satellites, is to take a number of readings and average these.
Another is to ignore changes that are within the accuracy supplied. Remember that the accuracy value is a 'confidence' measure, not an error measurement.
04-27-2011 04:28 AM
This is the exactly the kind of info I was looking for. I'm just starting with the GPS stuff
and want to forumulate my plan of attack before I start coding.
Can I collect some approaches here and have everyone comment?