locked
Incorrect GPS information RRS feed

  • Question

  • Hi,

    I am facing a strange problem. I am using GPSGetPosition() API from native gpsapi.dll which is working fine most of the time. However, in some instances, it gives a very wrong position, may be 100 miles a way or 500 miles away and then after a while it again starts giving accurate position. I initialy observed this behaviour with HTC phone and thought it could be HTC problem. Now I can see same problem with motorola MC65 phone as well. It has got windows mobile 6.5.

    Anyone else noticed this problem, Microsoft guys, please drop some lines.

    Best Regards,

    B

     

    Monday, October 31, 2011 2:47 PM

All replies

  • You need to check for the GPS_VALID_ flags in GPS_POSITION::dwValid.

    GPS_POSITION pos = { 0 };
    pos.dwSize = sizeof( pos );
    pos.dwVersion = GPS_VERSION_1;
    
    // adjust as necessary
    DWORD max_age = 0;
    
    if( GPSGetPosition( handle, &pos, max_age, 0 ) == ERROR_SUCCESS )
    {
        if( pos.dwValid & GPS_VALID_LATITUDE != 0 &&
    	    pos.dwValid & GPS_VALID_LONGITUDE != 0 )
        {
    	    // congratulations, you have a valid position.
    	}
    }
    


    -PaulH

    • Proposed as answer by Jesse Jiang Wednesday, November 2, 2011 6:11 AM
    • Marked as answer by Jesse Jiang Monday, November 7, 2011 8:36 AM
    • Unmarked as answer by bsengar Thursday, November 24, 2011 3:10 PM
    Tuesday, November 1, 2011 1:45 PM
  • Hi PaulH,

    Sorry for the delayed reply as I was away. First, thanks for reply. I am checking for GPS_VALID_ flags and it works good most of the times. The problem is however, sometimes suddenly the position returned is about hundreds of miles away from actual position in few seconds and when I do further updates, it starts giving correction position.

    Sometimes, it gives further positions relative to drifted position. In one instance, the device was sailing in the english channel for about 10 miles before coming back to normal position.

    Initially we thought its hardware problem specific to HTC phones, however we can now see it on Motorola devices as well. I am not sure if anyone else faced similar problems but it looks something to do with Microsoft Location APIs.

    Any ideas/suggestions would be really helpful.

     

    Regards,

    Braj

    Thursday, November 24, 2011 3:10 PM
  • You can also look at the DilutionOfPrecision parameters to see how accurate the GPS fix is. http://msdn.microsoft.com/en-us/library/bb202062.aspx

    If that still isn't acceptable, then you can try connecting to the GPS as a serial device and decoding the NMEA strings yourself.

    I haven't personally encountered any issues with the Location API that couldn't be traced back to the OEM implementation of the GPS or GPS drivers. But, I don't get out to England often and it could be the English Channel has special magnetic properties that distort the Aether. ;-)

    -PaulH

    Monday, November 28, 2011 2:59 PM