4

I am writing a UWP application and in one case I need to use geolocation from Windows. For this I use Windows.Devices.Geolocation.Geolocator. However, there is a problem with accuracy. For example, if the location sensor gives me data with error radius of 3.87, then the Geocoordinate shows this value as 3, even though Accuracy property has double type.

Data in location sensor: Data in location sensor

What I receive from Geolocator: What I receive from Geolocator

Accuracy property is double: Accuracy property is double

It seems that the Geolocator simply takes the integer part of the number and ignores the fractional. However, a problem occurs when error radius value is less than one.

Data in sensor: Data in sensor

What I receive from Geolocator: What I receive from Geolocator

In this case, I get an Accuracy value of 0. The documentation (here) says that if the Accuracy value is 0, then accuracy level is unknown and Location API gives priority to sensors that provide a non-zero value.

SENSOR_CATEGORY_LOCATION doc: SENSOR_CATEGORY_LOCATION doc

Geolocator begins to take data by IP address with an Accuracy of 165852 meters (for him, this data is more accurate than 0)

Geoposition using IP address: Geoposition using IP address

The fact is that I always need to work with a sensor that gives an accuracy of less than 1 meter.

Has anyone encountered such a problem? And what decision did you make?

  • And what's your *real* question? – IInspectable Nov 23 '19 at 18:24
  • 1
    @IInspectable The real question is that I don’t understand whether this is my problem or a problem in Geolocator – Nikolai Kobets Nov 25 '19 at 09:50
  • First, this [document](https://docs.microsoft.com/en-us/windows/win32/sensorsapi/sensor-category-location) you mentioned actually refer to a sensor document not an Accuracy from Geocoordinate. What it says is if the sensor shows the value is zero, then it is unknown. And this [document](https://docs.microsoft.com/eu-es/uwp/api/windows.devices.geolocation.geocoordinate.accuracy) about Accuracy doesn't mention if the Accuracy value is 0, accuracy level will be unknown. In addition, this document also doesn't mention it will return the entire value even if the Accuracy property is double. – Faywang - MSFT Dec 04 '19 at 09:09
  • And can you tell us why you want an Accuracy value with the fractional? – Faywang - MSFT Dec 04 '19 at 09:10

0 Answers0