Ideas on iOS GPS tracking needed

Alan Stenhouse alanstenhouse at hotmail.com
Tue Nov 3 17:39:44 EST 2020


Hi Graham

Are you checking the horizontal accuracy of each reading? (It's part of the array of data with your lat-longs, as well as speed, etc - though not on every phone). 

If not, try that and see if the anomalous readings are hugely out. From my experience, that's normally the case. If so, the easiest thing is to drop them in the short term, unless you get too many and then you may need to be a bit fancier. If you do, would love to hear the solution that you come up with.

HTH, cheers

Alan

> On 4 Nov 2020, at 3:30 am, Graham Samuel <livfoss at mac.com> wrote:
> 
> From: Graham Samuel <livfoss at mac.com>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Subject: Ideas on iOS GPS tracking needed
> Message-ID: <6C855814-1850-4975-B185-1731EFCD6DA2 at mac.com>
> Content-Type: text/plain;	charset=utf-8
> 
> Sorry this is a bit long.
> 
> For a long time I?ve been tinkering with an app that uses the GPS on iPhones to show how far ?as the crow flies? the user is from some base point, which is set before the journey starts. It?s intended for walkers and cyclists, and I was using a beta version in the first French lockdown, which forbade one walking more than 1km from one?s house. I put the completion of this aside, but now we?re in the second French lockdown and it looks worth finishing - but I have some issues which I believe are not just down to my bad coding (though of course that?s more than possible), and I wonder if anyone else has thought about this stuff.
> 
> The basic idea is extremely simple, as you can imagine, and it wasn?t hard to code. The app keeps working out the point-to-point distance from the base and tests it against the permitted limit. If the limit is exceeded, it sounds an alarm. If the user goes back within the limit, the alarm stops. Everything else is just cosmetic, really.
> 
> The issue I have is that in every journey of say 40 minutes to an hour, the iPhone appears to generate a few ?bad? GPS readings. When I say bad, I mean way beyond the published accuracy of the GPS (which varies up to about 70m). Sometimes the GPS wants to tell me that I?ve walked half a kilometer in three seconds!
> 
> I have analysed a lot of data (.gpx files) from other apps for walkers, drivers and cyclists and I don?t see such glaring anomalies; and using such apps on my main test phone (an iPhone X), I don?t see these strange readings affecting the data.
> 
> Assuming this isn?t just a stupid coding error on my part (OK, a risky assumption), I need to find a solution, either by increasing the accuracy of the readings, or by finding the anomalies as they occur and eliminating them. I know no way of doing the first, and although I have ideas for the second (check apparent speed, for example), none seems foolproof. As the app works in real time, a retroactive curve-fitting solution is no good for me, even if my maths was up to coding it (Kalman filter, anyone?).
> 
> Has anyone tried anything like this, and if so, did you find any anomalies in the data, and how did you cope with them?
> 
> I?d be grateful for any ideas.
> 
> Graham





More information about the use-livecode mailing list