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: 81
Registered: ‎06-24-2009
My Device: Not Specified

GPS coords

[ Edited ]

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

Developer
Posts: 466
Registered: ‎03-04-2009
My Device: 8520
My Carrier: some

Re: GPS coords

Developer
Posts: 81
Registered: ‎06-24-2009
My Device: Not Specified

Re: GPS coords

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.

Developer
Posts: 466
Registered: ‎03-04-2009
My Device: 8520
My Carrier: some

Re: GPS coords

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?

 

 

Got resolved! Press kudo icon!
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: GPS coords

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. 

Highlighted
Developer
Posts: 81
Registered: ‎06-24-2009
My Device: Not Specified

Re: GPS coords

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?