Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 102
Registered: ‎07-15-2008
My Device: Not Specified

Strange GPS fixes from an otherwise working application

I have a application that gets fixes every couple of minutes throughout the day.  However, I've got a few phones out in the field that are getting strange fixes hundreds of miles or more away.  Is there something I have to check to see that a fix is truly valid other than making sure the location is valid and I can get the qualified coordinates?

 

 

 Location l = lp.getLocation(lastFixValid ? 55 : 120);
            timeoutTimer.cancel();
            System.err.println("Past getLocation()");
            
            if (l != null && l.isValid()) {
                Coordinates c = l.getQualifiedCoordinates();

 

Location l = lp.getLocation(120);

if (l != null && l.isValid()) {                

       Coordinates c = l.getQualifiedCoordinates();

       if (c != null) {

           // SHOULD I HAVE A GOOD FIX HERE?

Developer
Posts: 19,628
Registered: ‎07-14-2008
My Device: Not Specified

Re: Strange GPS fixes from an otherwise working application

Just because it is valid does not mean it is good.  You can try setting the accuracy, but to be honest, in my experience, you have to be able to cope with outliers - random locations.  In my experience, I would be very, very suspicious of any fix that that has fewer than 5 satellites.  After that, do some sense checking given the previous location - you can't move 100 miles in 10 seconds.  Typically also I find that the Altitude change is a give away for a dubious reading that should be discarded.

 

So I recommend doing "sense" checks on locations with 6 or more satellites.  Other people take the last 10 readings and average them.  I'm sure other people have different approaches.  But the short answer, valid does not mean accurate.

Developer
Posts: 102
Registered: ‎07-15-2008
My Device: Not Specified

Re: Strange GPS fixes from an otherwise working application

Peter,

Thanks.  I'll likely test to make sure I get at least 6 sats before considering it a "good" fix.  

 

If anyone has a better/proven (or more complete) strategy I'd like to hear it...