I have been using the FusedLocationProviderClient (FLP) and testing it's accuray.
I keep getting systematic erratic readings. I suspect it's location fixes provided by cell towers, but they are far too noisy. Does anyone else have this problem?
If so, how can it be fixed?
I'm not sure if I have to implement a filter outside of it, I don't necessarily want to, I believe the FLP is smarter than I, or at least the team of engineers who implemented it are.
Here is an image of data when I was stationary during the sampling period.
Update
So beyond adding high accuracy priority on the location request, I had to manually filter Location objects on their accuracy property location.getAccuracy(). Some locations like the ones in the picture above were around 1km away from true location and they would occur every so often adding a lot of noise to running calculations like distance travelled etc...
Related
So I know you can use getAccuracy() to find the accuracy of a location but if you set up a cut off for the accuracy, can you prevent recording down one of those locations where it's hugely off mark of where the user is? Like if the user is still, most location updates cluster around his area but occasionally the location provider will hiccup and report the location as somewhere miles away.
Do these locations simply appear as "accurate" with getAccuracy? Or would they turn up as some insanely high getAccuracy() result? Programming a cut off point is easy enough but I was wondering if I would have to code extra checks such as if a location is way too different from the previous ones then it's a wayward one.
Accuracy is not the only deciding factor here. You should also look at the age of the location, and the provider if you get it (the Google Play Services location doesn't tell you, but the original Android LocationManager does).
In fact, Google has some useful sample code for maintaining a current best estimate. I have used a variation of this to filter out wild jumps in incoming location data. Essentially a location is not even reported if it doesn't pass this gate.
I am tracking rider's location(bike rider) and calculating total distance travelled per session by him. I have used fused location api only (no GPS). There are times when I am getting jumps in location and due to these jumps extra distance is added,hence results in overall wrong distance. Please help me in finding these wrong latitude and longitudes. Is there any good filter which can be easily implemented in Android or any good method for the same?
Distance measurement on raw GPS data will always be noisy, because the underlying data is often inaccurate. These jumps are due to inaccurate location measurements. To achieve, accurate distance measurements, you can need to filter the noise in the data.
Some useful filtering techniques that you can explore are:
Smoothening location data using Kalman filters - see tutorial
Snapping to road with Google maps snap-to-roads API, or OSRM match service.
If you are looking for an end-to-end solution that gives accurate location data and distance measurements, you can also try the HyperTrack SDK for Android or iOS. You can read about how they filter locations to improve accuracy on their blog. (Disclaimer: I work at HyperTrack.)
Location isn't exact. Even with GPS it isn't. Fused location can be off by hundreds of meters. If you're standing still every few minutes you'll get one reading that's just really off. Sometimes I walk from my kitchen to the bathroom and it thinks I've gone a quarter mile. If you look at the accuracy it returns, remember that there's a 2/3 chance you're within that distance. There's still a 33% chance that you're nowhere within that radius.
You're going to have to accept inaccuracy. There are a few ideas you can do though
1)Ignore all updates unless they travel at least some minimum distance. Adding in all those little amounts will add a lot of inaccuracy quickly.
2)Require at least 2 updates near a new location before accepting that as the new location.
But if you're using network location for short movements- you're going to have a difficult time of it.
Go to Settings -> Location -> Mode.
And make sure the mode is set to Device only.
This will stops the jump
I am in need to develop an android app where the device will track the distance traveled while the user is in a moving vehicle. I am getting the GPS values at small interval so that I can retrieve the distance and sum them up. But the problem I am facing is, while the user is in the vehicle, the device is not getting a clear view of the sky. Hence, the GPS device cannot get values as frequently as I desire. Thus, the result produced contains huge fluctuations. I tried using the network provider, but that is even worse in this scenario.
It would be very much helpful if anyone can suggest me a solution to this problem.
Just put the receiver onto the inner side of the windshield, like all navigation systems do. This should give an acuracy of about 3-6m. (when SBAS correction is available in your location) or up to 10m if not.
If the receiver is not state of the art (combined GPS + GLONASS or BEIDOU) then you will have problem in cities, especially in urban canyons with location jumps up to 30m.
This is normal. To get correct result for a GPS application within a city you need advanced algorithms. Just summing up the distance between two consecutive locations is to primitive, this never works well. Distance calculation by GPS has be answered some times her at SO. Use the search engine, to get more info at that topic.
Of course, set the device to GPS provider only, with maximum precision.
In application I need to get geo position of phone every x minutes (for now it's 5min and 50m), in such a way that phone doesn't discharge during day. The accuracy of position must be at least 40m. By now I have listeners for gps and network. The problem lies in the fact that the data I can receive sometimes is totally wrong (depends on phone) - new position can be even 200m from my real position and with 40m accuracy; next point can be the same but in opposite direction. For my app it's fatally.
So the question is next: Is there any way to get more accuracy data but not very often?
Update 1: to show the problem in action:
(The phone is lying in the fixed position)
To get more accurate location make sure you're using the ACCESS_FINE_LOCATION permission in your manifest. To prevent higher battery usage, you can use setInterval and setFastestInterval on your LocationRequest object. Longer intervals mean less battery usage by your app.
You should not be accessing the gps and network directly, you should be using LocationManager and using ACCURACY_FINE in your Criteria. This will help conserve battery life, and avoid issues with phones where the gps may have been disabled. There's more detail on that here.
As far as the accuracy of your location, you can use Location's getAccuracy method to get Android's estimate of how accurate a measurement is. If it doesn't fit your criteria, discard it and poll again.
I am using GPS to fetch location at 15 second interval in my android application. It is giving correct data but sometimes it fetches forward location and after that again fetches backward location. In result i am getting wrong track on google map.
Please help.
Your question is a little big vague...
The problem with GPS is that it is highly dependent on your whereabouts. Things such as tall buildings and sometimes even large trees can have a major impact on your GPS readings. Being inside a structure or outside is also another major factor which must be considered. Also, most of the time, the GPS will return different GPS co-ordinates even if you stay in the same place.
The average margin of error of a GPS usually varies between 5 and 50m. When you say 'forward' and 'backward' location, I am assuming that you mean that the GPS is returning a value for a position which is either ahead of you or behind you.
The fact that, as you say, the GPS most of the time works, leads me to suspect that the issue you are experiencing varies depending on your actual physical location, however, due to the vague nature of your question we can only speculate...
My suggestion is that you try this out in various places, maybe some with clear access to the sky, and another in a crowded area and you see how the GPS behaves.
I too faced same problem while testing my Google navigation app.
The wrong location from GPS receiver is due to the lack of signal reception from GPS Satellites to GPS receiver.
This is due to the position of your GPS receiver device and also depends on the quality of GPS receiver.