Вопрос

I'm writing my first Android application, and have utilized the Android Location Manager to obtain GPS readings. I a bit confused about the accuracy readings I'm getting. For example:

  1. I used a tape to measure out 1000 linear feet between two points.

  2. While standing at point A I started the location manager update requests until I received an accuracy of +/- 4 feet.

  3. I then hit a button in the app to save that particular location (private var).

  4. While the location manager continues to poll I walked the line until I reached point B.

  5. Once here I waited for an accuracy reading of +/- 4 feet.

  6. I then hit another button which takes that location and performs a distance measurement between the two points i.e.:

    double distance = startLocation.distanceTo(endLocation);

  7. The returned distance measurement was 1000.20 feet.

I realize that the returned accuracy measurement from the GPS is constantly fluctuating, but I expected that the distance measurement would at least reflect this somewhat. I was surprised at it's precision in comparison to the accuracy readings.

So my question is should I trust the value from the distance measurement, or take into consideration the accuracy measurement returned from the GPS?

Это было полезно?

Решение

If you look at the API reference for Android location you will see the explanation for the accuracy reading as:

We define accuracy as the radius of 68% confidence. In other words, if you draw a circle centered at this location's latitude and longitude, and with a radius equal to the accuracy, then there is a 68% probability that the true location is inside the circle.

In statistical terms, it is assumed that location errors are random with a normal distribution, so the 68% confidence circle represents one standard deviation. Note that in practice, location errors do not always follow such a simple distribution.

This accuracy estimation is only concerned with horizontal accuracy, and does not indicate the accuracy of bearing, velocity or altitude if those are included in this Location.

If this location does not have an accuracy, then 0.0 is returned. All locations generated by the LocationManager include an accuracy.

Per this post it looks like getAccuracy and distanceTo() methods do not take each other's measurements into consideration. I would follow the advice in the post and check out the GPS Benchmark application for better information from your specific hardware. Hope this helps!:

Does Location getAccuracy take distanceTo() into Account?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top