本文介绍了[UWP] Geolocation Inaccurate Readings的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 var locator = new Geolocator()
                    {
                        DesiredAccuracyInMeters = 50
                    };

                    var position = await locator.GetGeopositionAsync(TimeSpan.FromSeconds(15), TimeSpan.FromMinutes(1));
                    double minimumAccuracyAllowedInMeters = 1000;

                    if (position.Coordinate != null)
                    {
                        if (position.Coordinate.Accuracy <= minimumAccuracyAllowedInMeters)
                        {
                            Latitude = position.Coordinate.Point.Position.Latitude;
                            Longitude = position.Coordinate.Point.Position.Longitude;

                            CoordinatesChanged?.Invoke(nameof(GeoLocation), (Latitude.Value, Longitude.Value));
                        }
                    }

我正在尝试利用地理定位来查找当前用户的位置,并将其反向地理编码为可读地址。我想要的准确度在50米以内,但我有时会得到结果,准确度为  267092
米。有时结果是在不同的教区/县(或城市)。是否有任何方法或设置可以使地理位置更可靠?在精确
是否在合理范围内之前,是继续进行位置调用还是依赖位置更改事件的最佳解决方案?

I'm trying to utilize geolocation to find the current user's location and reverse geocode it to a readable address. My desired accuracy is within 50 meters, but I'm getting back results, at times, with an accuracy of 267092 meters. Sometimes the results are in a different parish/county (or city). Is there any way or settings to add that will make geolocation more reliable? Is the best solution to keep making location calls or rely on the position changed event until the accuracy is within a reasonable range?

使用Windows 10移动设备运行Windows 10移动企业版,操作系统版本10.0.14393.1198或10.0.14393.2551。用户使用便携式mifi设备使用wifi。

Using Windows 10 Mobile Device running Windows 10 Mobile Enterprise, OS version 10.0.14393.1198 or 10.0.14393.2551. The users are on wifi using portable mifi devices.

推荐答案

有很多事情可能会影响地理定位的结果。保持呼叫位置请求可能会导致不必要的费用。所以在我的建议中,你可以处理
事件以接收用户位置的更新。

There are many thing that might affect the result of Geolocation. Keep calling location request might cause unnecessary cost. So in my suggestion, you could handle thePositionChanged event to receive updates of the user's location.

祝你好运,

Roy


这篇关于[UWP] Geolocation Inaccurate Readings的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 03:54