Has anyone experience of GPS on iPhone?

Hillen Richard mail at richard-hillen.de
Wed May 6 15:21:26 EDT 2020

Hello Graham,

20 years ago I started to use GPS-technique and found the same mysteries as you do now.

I learned that there a two main reason for the variation of location data:

Atmosperic density variations cause short term runtime variations and
Different relativ positions of satellites cause long term triangulation errors.

So I sampled at a constant location over some days the position data delivered from a gps-receiver taken every 10 seonds.

First I plotted the data and found that there were local shorttime-variations around a center, which was wandering slowly over the plot-area. The shorttime-fluctuations were most in a range of +-5m, the longtime-area showed - if I remember right - a radius from +-20m.

After that I started to calculate time-series of mean-values over different minute-intervalls and learned by plotting the result again, how to smooth my data best.

Nowadays you will of course get smaller short-time variations using the more intelligent gps-receiver of an iphone, but it probably gives you an impression about what is going on there.


> Message: 17
> Date: Wed, 6 May 2020 15:09:16 +0200
> From: Graham Samuel <livfoss at mac.com>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Subject: Re: Has anyone experience of GPS on iPhone?
> Message-ID: <074980D0-F69D-45AF-9891-5CEB351F3ADD at mac.com>
> Content-Type: text/plain;	charset=utf-8
> Bill, I think you are confirming that there is some mystery here. There are a lot of apps that seem to get location, and measures derived from location, almost completely right, whereas I am having trouble doing so with what must be the same essential data.
> Take the problem of measuring the length of a country walk (I mean a walk not in a straight line). My basic approach is to process locationChanged messages, which unsurprisingly are triggered every time the GPS-measured location changes. So as not to get overwhelmed with very small, frequent changes, I only process a locationChanged message every 3 seconds - I know at least one other app that does this. As a person probably walks up to two metres a second, this fits in with what we know about accuracy, I think. The method is very simple. Every time we respond to a locationChanged message, we work out the straight line distance delta as in
>  delta = (where we were 3 seconds ago) - (where we are now)
> Ignoring the sign of the result, of course. This can be done by Haversine or similar algorithms for measuring short distances on the Earth?s surface - it?s essentially a Pythagoras calculation. Then we add up all the deltas and we know how far we walked on the trip with a fair if not complete degree of accuracy - easy! 
> Only there are complications. Of course if any delta is zero, it doesn?t contribute to the trip; but what if it?s **nearly** zero - is it sensible to ignore very small deltas on the grounds that they are due to GPS wobble, or should we put them all in? 
> Here?s what happened when I tried to do it: first I calculated the deltas to two decimal places, and I found that I was badly underestimating the distance walked; so then I pushed up the accuracy of the calculation to 5 decimal places. Sure enough, the measured route got longer in kilometers, until I noticed that if I simply put the phone on the grass and left it, so it wasn?t moving at all, in about 45 minutes I?d accumulated a completely spurious half a kilometre of walking! The small variations in the GPS signal (what I call the wobble) must have been responsible, since there was no other source of data but the GPS reading.
> How then to avoid either under- or over-estimating the trip distance? Plenty of apps have done it but I just can?t see how, although I keep tinkering with the parameters. Of course I can never forget that my scripting might just be plain wrong, but so far my incremental method hasn?t worked sufficiently well, in the sense that if run the app and choose to walk in an exact straight line, I can compare a single measure of distance from the starting point with my integral approach. So far the result is not even close. As you say, intensive Internet searches are called for.
> I wish all this were easier.
> Graham

More information about the use-livecode mailing list