我正在像这样使用 Windows Phone GeoWatcher 获得坐标
private GeoCoordinateWatcher _watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
_watcher.MovementThreshold = 2; // Threshold Value
_watcher.PositionChanged += Watcher_PositionChanged; //Registering Watcher Position Change Event
_watcher.Start(); // Starting Watcher
//Watcher position Change Event
private void Watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
{
var coord = new GeoCoordinate(Convert.ToDouble(e.Position.Location.Latitude.ToString("0.00000").Replace(",", ".")), Convert.ToDouble(e.Position.Location.Longitude.ToString("0.00000").Replace(",", ".")));
}
但是我在同一个地方得到了不同的经度和纬度值,即使我没有移动并且我也设置了阈值。如果我没记错的话,阈值意味着如果您至少覆盖了那么远的距离,那么它将为您提供新的坐标。由于当我静止不动时同一地点的坐标值不同,我的应用程序在距离检查中失败。因为它返回两个坐标的非零距离,实际上我没有移动。
这是我在同一地点捕获的一些读数。为了更好地分析,我删除了一些 0 距离条目。
Previous POint 31.49858, 74.36393 New Points 31.49858, 74.36393 distance 0
Previous POint 31.49858, 74.36393 New Points 31.49345, 74.36399 distance 570.95
Previous POint 31.49345, 74.36399 New Points 31.4935, 74.36195 distance 193.671
Previous POint 31.4935, 74.36195 New Points 31.4933, 74.36207 distance 25.002
Previous POint 31.4933, 74.36207 New Points 31.49324, 74.36264 distance 54.502
Previous POint 31.49324, 74.36264 New Points 31.49345, 74.36399 distance 130.226
Previous POint 31.49345, 74.36399 New Points 31.49355, 74.36227 distance 163.603
Previous POint 31.49352, 74.36229 New Points 31.49349, 74.36231 distance 3.840
Previous POint 31.49345, 74.36235 New Points 31.49343, 74.36238 distance 3.613
如果我不改变我的位置,我如何才能在距离方面获得准确度?它不应该给我不同的坐标。