Reputation: 2261
here's my problem: i wish to get some GPS data from the antenna on my phone and everywere i look i find almost the same example (like this Getting GPS coordinates on Windows phone 7). It's everything clear and simple but there's one thing missing, the accuracy. What i mean is, how can i know if the position returned is actually a reading from the GPS and not from a CellID triangulation ? It's not a problem for me to wait untill i get a good read but how can i know when to stop ? I don't know if i've been exhaustive in my exposure, i just want to know if there is some way to be sure that the position is not an approximation made triangulating some Cell Towers. Thanks
[Update]
I'm performing some test right now from inside my house with a device and the strange thing is i get as a result the coordinates pointing just outside my gate with the timestamp telling me it's a reading from 2 hours ago. It's not a problem with the caching mechanism, i could always check that timestamp and discard old values, but i really don't understand the HorizontalAccuracy
parameter: its value is 10000. Plotting the latitude and longitude coordinates on a map shows my home and thus it can't be a CellID triangulation (usually with GSM triangulation the most accurate position i get is about 300 - 400 meters from here). So, what does that 10000 value means ?
Thanks again :)
Upvotes: 4
Views: 7232
Reputation: 76
Just use this code:
var watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); // High mean GPS
I also recommend this:
wartcher.MovementThreshold = 0.5;
It id complex to explain but if you have event handling on warcher like PositionChnged then it will automatically fire every time someone move.
If you set MovementThreshold to 0.5 or even more like 1 or 2 the event will be fire if someone move for 0.5 meter or 1 meter and so on.
Upvotes: 2
Reputation: 39
According to the documentation the accuracy is in meters: http://msdn.microsoft.com/en-us/library/system.device.location.geocoordinate.horizontalaccuracy.aspx
Upvotes: 3
Reputation: 65586
GeoCoordinateWatcher deliberatley abstracts away the source of the information it uses to determine the source(s) of the location information it returns for simplicity of use.
At the moment you just have to trust the accuracy of the watcher, based on the GeoPositionAccuracy you specify in the constructor.
However, I suspect, like with most GPS based systems you may get a more accurate result if you request the location again after the Watcher has been running for a little while (as it may have been able to use information from more satellites in the triangulation).
Depending on the country you are in and the local geography can affect the accuracy of GPS information based on the number of satellites that can be used in the triangulation.
WiFi Hotspot accuracy can have varying levels of accuracy.
Cell tower location accuracy can vary depending on the area covered by the cell the phone is currently in or if it is in reach of multiple towers.
It is the accounting for the combination of all these variables which the QCW tries to protect you from.
If you really must only use GPS information then this is something which is not currently available from the SDK.
Upvotes: 6
Reputation: 1503290
The GeoCoordinate
itself contains the accuracy in the HorizontalAccuracy
property. And of course when you start the watcher you can specify the accuracy you want.
Admittedly I don't know the accuracy levels associated with cell towers, wifi hotspots and GPS - but I suspect you could experiment.
Upvotes: 2