none
GeoCoordinateWatcher returning wrong location RRS feed

  • Question

  • I am using GeoCoordinateWatcher to capture the device location. When watcher_PositionChanged() is fired and I check the GeoCoordinate, the position is not the current device location. Sometimes the location is previous location captured by the Bing Maps app. Other times using the Bing Map app does not change the location returned by GeoCoordinateWatcher.

    What am i doing wrong?
    Wednesday, January 5, 2011 4:29 AM

Answers

  • So I discard the initial results. But for how long? 5 seconds? 10 seconds?
    Since we live in a nondeterministic world I can't give you a hard number. It's possible the phone will get a quick fix on GPS or that it may never (using the term loosly) get a fix on GPS.  You could look at the HorizontalAccuracy member. If it is a magnitude of a large amount then keep the GeoCoordinateWatcher active until you get a magnitude that is within some toleration that you decide or until some time out value has passed. 
    Thursday, January 6, 2011 3:12 AM

All replies

  • You might not be doing anything wrong.  From what I gather from the documentation, there are a number of factors that affect the numbers that return.  Perhaps you can create a simple app that monitors the returned values, and also consider implement a running average algorithm to smooth out the results.

    Perhaps others in this forum who have further practical experience regarding GeoCoordinateWatcher can chime in.

    Hope this helps!
    Mark
    Wednesday, January 5, 2011 10:06 PM
  • The first location I get from the GeoLocationWatcher has always been the last position that the device had whether that position was acquired through Bing or some other location services app (ex:FourSquare). You may also get a weird location if you happen to be near a router that had previously been at a different location before it got added to Microsoft's database of access points.
    Thursday, January 6, 2011 12:27 AM
  • I am attempting to grab the current location and display on a map... the same way that the Bing Map app does. After I have the location I am done with the GeoLocationWatcher I don't need to track movement.

    If the first location from GeoLocationWatcher is the last position the device acquired, how do you get the current location?
    Thursday, January 6, 2011 2:12 AM
  • If the first location from GeoLocationWatcher is the last position the device acquired, how do you get the current location?

    All positions after the first position are the current position. 

    Note that location from Wi-Fi and Cell tower tend to be faster than GPS. If you just take the first (or second) reading you could be missing out on a more precise reading that may come after GPS hardware makes a fix. 
    Thursday, January 6, 2011 2:15 AM
  • So I discard the initial results. But for how long? 5 seconds? 10 seconds?
    Thursday, January 6, 2011 2:31 AM
  • So I discard the initial results. But for how long? 5 seconds? 10 seconds?
    Since we live in a nondeterministic world I can't give you a hard number. It's possible the phone will get a quick fix on GPS or that it may never (using the term loosly) get a fix on GPS.  You could look at the HorizontalAccuracy member. If it is a magnitude of a large amount then keep the GeoCoordinateWatcher active until you get a magnitude that is within some toleration that you decide or until some time out value has passed. 
    Thursday, January 6, 2011 3:12 AM
  • Thanks Joel

    That is exactly what I needed.
    Thursday, January 6, 2011 4:01 AM