Unbelievably inaccurate GPS points. What is the reason?

后端 未结 7 1803
广开言路
广开言路 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 18:50

    The most important take away I hope to leave you with is take time to understand your accuracy requirements and your user’s basic geographic behavior patterns. I’ve tried to liberally sprinkle example use cases to help illustrate some of the concepts.

    This is accomplished using the overloaded LocationManager.requestLocationUpdates() method. These properties adjust how aggressively the device will request location updates by minimum time elapsed and minimum distance traveled.

    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,listener);
    

    This method will resolve your issue a very basic set of technical requirements for dynamically changing requestLocationUpdates() settings:

    public void onLocationChanged(Location location) {
         if(location.getAccuracy() < 100.0 && location.getSpeed() < 6.95){
              //Do something
         }
         else{
              //Continue listening for a more accurate location
         }
    }
       
    
    • Start application using minTime= 0 and minDistance = 0. Use an aggressive setting to get accurate location as quickly as possible.

    • Once accuracy is less than 50 meters and speed less than 45 mph set minTime = 5000 and minDistance = 25.

    • Speed equals 0 for greater than 1 hour. Shut off location listeners and notify user.

    • Battery gets low. Shut off location listeners and notify user.

    0 讨论(0)
  • 2021-01-01 18:51

    If you're using Google fused location provider then those errors are bound to happen, so if you want the most accurate results and restrict them to GPS only, then use Android location framework instead of Google Play services Location API.

    You can also filter major distance changes if you want to continue using Google's Location API.

    0 讨论(0)
  • 2021-01-01 18:55

    There may be many reasons for this. Listing some of them.

    (1) GPS hardware used with in device.
    (2) Weather condition( This will not generate much difference in distance. This may make a difference of about 20-30 KM as per my testing )
    (3) Nearby location. This includes buildings and all other.
    

    It is true that some time Android GPS starts behaving wired. I also faced this problem while creating a cab based application.

    Solution by CommonsWare is almost a solution to your problem. There you may come up with some more specific algo to do the task.

    While testing this scenario, I found this problem with One-Plus-One devices while there was no issue with in One-Plus-Two devices.

    SOLUTION : You should check for maximum distance a user can travel within your time frame. Here time frame is the time of update of your GPS Location. This distance should be calculated on behalf of your previous valid Latitude and Longitude with respect to your current Latitude and Longitude.

    As per you logs I see the time difference between updates of your Location. Make sure that you have fix time intervals for your update.

    0 讨论(0)
  • 2021-01-01 18:59

    How to get more accuracy by GPS_PROVIDER

    You have to check the location has accuracy before you can use accuracy.

    Good luck.

    0 讨论(0)
  • 2021-01-01 19:01

    You can opt technique of Fused Location Api for better results,

    Nowdays which used commonly for location updates ,it always gives almost accurate or near about results in some meters not km.

    You can follow this Link

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题