Unbelievably inaccurate GPS points. What is the reason?

后端 未结 7 1854
广开言路
广开言路 2021-01-01 18:24

I have developed an application for Android, for storing user\'s GPS location.

One of my customers gave me his device and I noticed that sometimes the accuracy of t

7条回答
  •  太阳男子
    2021-01-01 19:04

    I want to know what can be the problem for this kind of inaccuracy?

    Hardware/firmware, most likely. In other words, blame Samsung.

    It's unlikely to be your app. Assuming that the accuracy values that you are getting for those failed points are within MAX_DISTANCE_TOLERANCE, and assuming that MAX_DISTANCE_TOLERANCE is less than 200km, you are faithfully using the data that you get. If that data is flawed, those flaws are coming from the system itself.

    You could create a more adaptive filter. In addition to testing the accuracy for MAX_DISTANCE_TOLERANCE, you could:

    • Calculate the time between the last location you were given and the new one that you are processing now
    • Calculate the maximum distance that could be covered in that time, based on some maximum speed that you expect the device to be going
    • Calculate the distance reported between those two locations (there's a static method on Location for this)
    • Reject locations where the reported distance is further than you think the device could have moved in this period of time

    For example, your first bad fix comes 20 minutes after the previous one. Unless you think the device might travel at 600 km/hour, you would reject the bad fix as being unrealistic.

    This algorithm will only work after you have a few consistent fixes. You might ask for rapid location updates for a few minutes, examine that data, throw out any outliers, then apply the "could the device really have travelled that far?" test for future fixes.

提交回复
热议问题