×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2010
    Location
    Zaandam, Holland
    Posts
    71

    Exclamation Fixing GPS Accuracy by applying Math

    To all,

    The purpose of this article is to find out HOW to mathematically calculate whether received locations are useful, or should be trashed because of inaccuracy.

    When plotting lines on a map, everything is okay, as long as the user is actually moving, and thus,
    gps locations received are okay.
    The problem usually starts when going inside. A global idea of where the user is still remains, but the accuracy of the fix drops insanely, and frequently deviates up to 50 meters from its actual location.

    For example:

    The blue line indicates a user driving in a car, reaching its destination.
    All is fine, until the user goes inside a building, and a whole knot of plotlines is being drawn as a result.
    The green 'star' is the actual location, and the blue lines around it are the locations submitted while the user is inside. The red lines are submitted when the user is inside for a long time, all at the same place.
    Now to the hard stuff.

    Example two:

    In figure 1, you can see a user virtually driving a straight line. Thus, the distance from the first point taken (the blue one) to each of its successors increases. So we could say, as long as the distance from the first location taken to each of their replacements increases, we can assume the user is moving and locations are accurate.

    But, (figure 2) this doesnt go for instance, when a user is driving on a roundabout. Lets say, you drive around a corner; The first locations taken after the very first one, WILL indeed be further away than the first one. Though, when you go over 50% on the roundabout (or corner) the later positions might be CLOSER to the first one again, so using this method to detect irradicality would not suffice.

    Then, figure 3, lets say the user is in the middle, and those lines drawn around him are all the result of being inside, none of them are actually "going" anywhere. Although one might be closer to the first one, and the other might be further, there is no real way to tell whether this is data we want or not.

    I've been breaking my brain on this for weeks now, took a holiday, and couldnt stop thinking about it.
    To those mathematically super-wise, please help me out.

    Note: I think it would be unwise to calculate distances on the device all the time, cos it might eat your battery. This -MIGHT- be done serverside, so dont hesitate to come up with something extremely heavy and difficult.

    Distance calculation between lat/lon's in javascript on nokia devices:
    Code:
    	getDistance: function(lat1, lng1, lat2, lng2, miles) {
    		var pi80 = Math.PI / 180;
    		lat1 *= pi80;
    		lng1 *= pi80;
    		lat2 *= pi80;
    		lng2 *= pi80;
    
    		var r = 6372.797; /* mean radius of Earth in km */
    		var dlat = lat2 - lat1;
    		var dlng = lng2 - lng1;
    
    		var a = Math.sin(dlat / 2) * Math.sin(dlat / 2) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(dlng / 2) * Math.sin(dlng / 2);
    		var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
    		var km = r * c;
    		
    		return (miles ? (km * 0.621371192) : km);
    	}
    Let's make this a follow up discussion.

    Thanks,

    Jasper

  2. #2
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,100

    Re: Fixing GPS Accuracy by applying Math

    Hello there, Jasper!

    Thank you for an interesting article indeed. You really have been digging into this area.

    WLAN to the rescue...?


    Comments, ideas, suggestions related - anyone?



    Best Regards,
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

Similar Threads

  1. GPS Accuracy
    By lokesh_kumar_s in forum Symbian
    Replies: 10
    Last Post: 2011-11-10, 11:01
  2. Replies: 2
    Last Post: 2010-03-31, 22:20
  3. Gps Accuracy
    By amit.mangal in forum Symbian
    Replies: 2
    Last Post: 2010-01-19, 14:00
  4. GPS accuracy
    By swelef in forum Symbian
    Replies: 2
    Last Post: 2009-01-30, 10:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×