Re: Has anyone experience of GPS on iPhone?

2020-05-08 Thread Graham Samuel via use-livecode
Thanks Richard

Your info is interesting and scary!

Please see my generalised reply, just published.

Graham

> On 6 May 2020, at 21:21, Hillen Richard via use-livecode 
>  wrote:
> 
> 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.
> 
> Richard.
> 
> 
> 
>> 
>> Message: 17
>> Date: Wed, 6 May 2020 15:09:16 +0200
>> From: Graham Samuel 
>> To: How to use LiveCode 
>> Subject: Re: Has anyone experience of GPS on iPhone?
>> Message-ID: <074980d0-f69d-45af-9891-5ceb351f3...@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.
>&g

Re: Has anyone experience of GPS on iPhone?

2020-05-08 Thread Graham Samuel via use-livecode
Just to conclude the tale: I have consulted the developers of one of my 
favourite apps that tells you how far you’ve walked or cycled (maybe long 
journeys as on sees on car satnavs are a different proposition, and I am not so 
interested in these for my own purposes). I am not revealing any secrets when I 
say that the lead guy reports that they have dedicated "tens of thousands of 
lines of code” to the issue. True, they cope with elevation, which I was 
planning to ignore, but nevertheless their ways of handling changes in accuracy 
include several things like reasonableness checks, so not even just simple 
curve-fitting.

In my particular circumstances and with my own limited skills I have simply 
decided to give up on that part of my app. A user can run another app 
simultaneously to mine to find out how far they’ve travelled - that’s easy. So, 
a wiser and a sadder man, I will try to finish what I started but with limited 
functionality.

Thanks to everyone who chipped in with advice, facts etc.

Graham

> On 6 May 2020, at 18:24, Graham Samuel via use-livecode 
>  wrote:
> 
> Mark, thanks for that contribution. Looks like more maths is needed. I will 
> follow up on your approach, as mine really only works if all GPS readings are 
> nearly accurate. As I have seen accuracies (really inaccuracies!) as large as 
> 65 metres even after a settling-down period, a few of those will certainly 
> put the integral-style calculation way out.
> 
> Really for this part of my app I need to emulate the work done in dozens of 
> trekking apps available in lots of countries. I have one sneaky idea, which 
> is to approach the developers of one of my favourite apps, since I have had 
> some contact with them on other matters, and just see if they might tell me 
> their approach - I can easily show that I am not a competitor! But that’s not 
> an approach I can rely on, of course!
> 
> I will keep plugging away even though the initial motivation for my app 
> (local lockdown) is probably going away. Hard to give up now.
> 
> Thanks everyone for their input.
> 
> Graham
> 
>> On 6 May 2020, at 16:52, Mark Waddingham via use-livecode 
>>  wrote:
>> 
>> On 2020-05-06 14:09, Graham Samuel via use-livecode wrote:
>>> 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.
>>> 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'm pretty sure that the data you are getting is precisely what all other 
>> apps will get - we are just returning the location data as provided by 
>> CoreLocation. The difference will be the analysis which these apps are doing 
>> on the data to derive an accurate assessment of the route taken I'd imagine. 
>> Indeed, it could be they also take into account other senses (compass and 
>> accelerometer) to help - but I don't know that for sure.
>> 
>> There are two functions which might help you with your endeavour:
>> 
>> mobileSetLocationHistoryLimit
>> mobileGetLocationHistory()
>> 
>> The details are in the docs, but basically the engine can collect and keep a 
>> list of locations which you can collect periodically.
>> 
>> I suspect the way to think about this is not to think about it as an 
>> incremental thing at all as any outliers will completely destroy the 
>> accuracy. Instead imagine it as a 'curve-fitting' exercise (piece-wise 
>> linear approximation is probably sufficient!) - i.e. taking sets of 
>> (slightly) overlapping samples and derive a 'best-guess' path which fits the 
>> data.
>> 
>> It is likely that some cleaning of the data would be needed first to 
>> eliminate outliers also. e.g. You can compute speed needed to get between 
>> individual points, if any given point is outside of a reasonable range of 
>> 'current' speed with approximated acceleration/deceleration taken into 
>> account then it should be discarded.
>> 
>> Doing a google search for "deriving a approximate path from gps data" turns 
>> up quite a lot of literature on the subject, so this is definitely something 
>> which has/is studied in depth...
>> 
>> Warmest Regards,
>> 
>> Mark.
>> 
>> -- 
>> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
>> LiveCode: Everyone can create apps
>> 
>> 

Re: Has anyone experience of GPS on iPhone?

2020-05-06 Thread Hillen Richard via use-livecode
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.

Richard.



> 
> Message: 17
> Date: Wed, 6 May 2020 15:09:16 +0200
> From: Graham Samuel 
> To: How to use LiveCode 
> Subject: Re: Has anyone experience of GPS on iPhone?
> Message-ID: <074980d0-f69d-45af-9891-5ceb351f3...@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
> 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Has anyone experience of GPS on iPhone?

2020-05-06 Thread Graham Samuel via use-livecode
Mark, thanks for that contribution. Looks like more maths is needed. I will 
follow up on your approach, as mine really only works if all GPS readings are 
nearly accurate. As I have seen accuracies (really inaccuracies!) as large as 
65 metres even after a settling-down period, a few of those will certainly put 
the integral-style calculation way out.

Really for this part of my app I need to emulate the work done in dozens of 
trekking apps available in lots of countries. I have one sneaky idea, which is 
to approach the developers of one of my favourite apps, since I have had some 
contact with them on other matters, and just see if they might tell me their 
approach - I can easily show that I am not a competitor! But that’s not an 
approach I can rely on, of course!

I will keep plugging away even though the initial motivation for my app (local 
lockdown) is probably going away. Hard to give up now.

Thanks everyone for their input.

Graham

> On 6 May 2020, at 16:52, Mark Waddingham via use-livecode 
>  wrote:
> 
> On 2020-05-06 14:09, Graham Samuel via use-livecode wrote:
>> 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.
>> 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'm pretty sure that the data you are getting is precisely what all other 
> apps will get - we are just returning the location data as provided by 
> CoreLocation. The difference will be the analysis which these apps are doing 
> on the data to derive an accurate assessment of the route taken I'd imagine. 
> Indeed, it could be they also take into account other senses (compass and 
> accelerometer) to help - but I don't know that for sure.
> 
> There are two functions which might help you with your endeavour:
> 
>  mobileSetLocationHistoryLimit
>  mobileGetLocationHistory()
> 
> The details are in the docs, but basically the engine can collect and keep a 
> list of locations which you can collect periodically.
> 
> I suspect the way to think about this is not to think about it as an 
> incremental thing at all as any outliers will completely destroy the 
> accuracy. Instead imagine it as a 'curve-fitting' exercise (piece-wise linear 
> approximation is probably sufficient!) - i.e. taking sets of (slightly) 
> overlapping samples and derive a 'best-guess' path which fits the data.
> 
> It is likely that some cleaning of the data would be needed first to 
> eliminate outliers also. e.g. You can compute speed needed to get between 
> individual points, if any given point is outside of a reasonable range of 
> 'current' speed with approximated acceleration/deceleration taken into 
> account then it should be discarded.
> 
> Doing a google search for "deriving a approximate path from gps data" turns 
> up quite a lot of literature on the subject, so this is definitely something 
> which has/is studied in depth...
> 
> Warmest Regards,
> 
> Mark.
> 
> -- 
> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Has anyone experience of GPS on iPhone?

2020-05-06 Thread Prothero-ELS via use-livecode
Graham,
Mark’s comments make sense. Your quality test where you set the phone down in a 
fixed location and look at the results seems good also. If it can’t pass that 
test, nothing else will work.
Best,
Bill

William Prothero
https://earthlearningsolutions.org

> On May 6, 2020, at 7:52 AM, Mark Waddingham via use-livecode 
>  wrote:
> 
> On 2020-05-06 14:09, Graham Samuel via use-livecode wrote:
>> 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.
>> 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'm pretty sure that the data you are getting is precisely what all other 
> apps will get - we are just returning the location data as provided by 
> CoreLocation. The difference will be the analysis which these apps are doing 
> on the data to derive an accurate assessment of the route taken I'd imagine. 
> Indeed, it could be they also take into account other senses (compass and 
> accelerometer) to help - but I don't know that for sure.
> 
> There are two functions which might help you with your endeavour:
> 
>  mobileSetLocationHistoryLimit
>  mobileGetLocationHistory()
> 
> The details are in the docs, but basically the engine can collect and keep a 
> list of locations which you can collect periodically.
> 
> I suspect the way to think about this is not to think about it as an 
> incremental thing at all as any outliers will completely destroy the 
> accuracy. Instead imagine it as a 'curve-fitting' exercise (piece-wise linear 
> approximation is probably sufficient!) - i.e. taking sets of (slightly) 
> overlapping samples and derive a 'best-guess' path which fits the data.
> 
> It is likely that some cleaning of the data would be needed first to 
> eliminate outliers also. e.g. You can compute speed needed to get between 
> individual points, if any given point is outside of a reasonable range of 
> 'current' speed with approximated acceleration/deceleration taken into 
> account then it should be discarded.
> 
> Doing a google search for "deriving a approximate path from gps data" turns 
> up quite a lot of literature on the subject, so this is definitely something 
> which has/is studied in depth...
> 
> Warmest Regards,
> 
> Mark.
> 
> -- 
> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Has anyone experience of GPS on iPhone?

2020-05-06 Thread Mark Waddingham via use-livecode

On 2020-05-06 14:09, Graham Samuel via use-livecode wrote:

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.

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'm pretty sure that the data you are getting is precisely what all 
other apps will get - we are just returning the location data as 
provided by CoreLocation. The difference will be the analysis which 
these apps are doing on the data to derive an accurate assessment of the 
route taken I'd imagine. Indeed, it could be they also take into account 
other senses (compass and accelerometer) to help - but I don't know that 
for sure.


There are two functions which might help you with your endeavour:

  mobileSetLocationHistoryLimit
  mobileGetLocationHistory()

The details are in the docs, but basically the engine can collect and 
keep a list of locations which you can collect periodically.


I suspect the way to think about this is not to think about it as an 
incremental thing at all as any outliers will completely destroy the 
accuracy. Instead imagine it as a 'curve-fitting' exercise (piece-wise 
linear approximation is probably sufficient!) - i.e. taking sets of 
(slightly) overlapping samples and derive a 'best-guess' path which fits 
the data.


It is likely that some cleaning of the data would be needed first to 
eliminate outliers also. e.g. You can compute speed needed to get 
between individual points, if any given point is outside of a reasonable 
range of 'current' speed with approximated acceleration/deceleration 
taken into account then it should be discarded.


Doing a google search for "deriving a approximate path from gps data" 
turns up quite a lot of literature on the subject, so this is definitely 
something which has/is studied in depth...


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Has anyone experience of GPS on iPhone?

2020-05-06 Thread Prothero-ELS via use-livecode
Graham,
You have probably done this, but maybe not, so...
I would not process each location changed value as a distance moved. I would 
use them to average a new location, and use that location, after averaging, to 
calculate the distance moved. Also, location changed messages may not come at 
equal time intervals, so bad values may induce bias in an average, and that 
could be be source of spurious distances.

So, the first calculation would be to get a good location. Then that location 
would be used to calculate a distance moved. You could try to calculate the 
standard deviation of the location average to try to get an estimate of quality 
and possibly reject bad ones. Also, if location changed messages come in 
unequal intervals, and you include a burst of bad values in your average, it 
will bias the average. You might want to simply query the gps location at equal 
time intervals for your average location calculation.

I haven’t tried to use the iPhone gps to do these calcs, so I’m just thinking 
off the “top” of my head. It is an interesting problem, though, so please keep 
me informed when you figure it out. 

Have fun! It’s science!

Best,
Bill



William Prothero
https://earthlearningsolutions.org

> On May 6, 2020, at 6:10 AM, Graham Samuel via use-livecode 
>  wrote:
> 
> 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
> 
>> On 5 May 2020, at 15:58, Prothero-ELS via use-livecode 
>>  wrote:
>> 
>> Graham,
>> This makes me wonder how the Google and Apple Maps get their accuracy. When 
>> driving or walking, trying to figure out how to get to an address, it shows 
>> me walking along a street, certainly more accurate than 20meters. Yet, when 
>> I’m wondering where my wife is, and load up “Find My iphone”, the location 
>> does jump around (easily 20 meters) for awhile, then seems to settle down. 
>> Hmm... In the olden days, NASA used to add error into publicly available gps 
>> readings, for security reasons. But now errors are not added and geo 
>> scientists are measuring very small fault motion with gps, but it’s 
>> comparing relative motion between two stations so

Re: Has anyone experience of GPS on iPhone?

2020-05-06 Thread Graham Samuel via use-livecode
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

> On 5 May 2020, at 15:58, Prothero-ELS via use-livecode 
>  wrote:
> 
> Graham,
> This makes me wonder how the Google and Apple Maps get their accuracy. When 
> driving or walking, trying to figure out how to get to an address, it shows 
> me walking along a street, certainly more accurate than 20meters. Yet, when 
> I’m wondering where my wife is, and load up “Find My iphone”, the location 
> does jump around (easily 20 meters) for awhile, then seems to settle down. 
> Hmm... In the olden days, NASA used to add error into publicly available gps 
> readings, for security reasons. But now errors are not added and geo 
> scientists are measuring very small fault motion with gps, but it’s comparing 
> relative motion between two stations so wouldn’t apply in your case. I think 
> some serious internet searching may be in order.
> 
> You must have tried Google Maps with satellite view, to see where it puts you 
> relative to your house. You might be interested in this demo of getting 
> google maps from Livecode.
> 
> http://earthlearningsolutions.org/google-static-maps-demo/
> 
> I  made a basic version of this and a hermann (hh), who helped me figure out 
> the boundary coordinate calculation, added to it. I think it’s also in the 
> livecode repository. It’s a couple of years old, so  
> 
> Best,
> Bill
> 
> William Prothero
> https://earthlearningsolutions.org
> 
>> On May 5, 2020, at 2:30 AM, Graham Samuel via use-livecode 
>>  wrote:
>> 
>> Thanks Bill for your two messages. I see from the link you gave that the LC 
>> system is (as expected) simply a wrapper for the iOS API, and indeed the 
>> term “horizontal accuracy” is actually used internally in iOS. So it’s 
>> unlikely that LC itself is adding to my problems.
>> 
>> I don’t have access to an entirely different GPS system - all mine are on 
>> iPhones and I’m in lockdown. Google Earth reckons my reference point is at 
>> 43.276693, 2.160029. (The curious can see where I live).
>> 
>> Here is a little test done by simply sitting on a bench in my garden - as 
>> far as possible, this is what Google Earth is looking at.
>> 
>> Another app - “MyAltitude” on my phone. L

Re: Has anyone experience of GPS on iPhone?

2020-05-05 Thread Prothero-ELS via use-livecode
Graham,
This makes me wonder how the Google and Apple Maps get their accuracy. When 
driving or walking, trying to figure out how to get to an address, it shows me 
walking along a street, certainly more accurate than 20meters. Yet, when I’m 
wondering where my wife is, and load up “Find My iphone”, the location does 
jump around (easily 20 meters) for awhile, then seems to settle down. Hmm... In 
the olden days, NASA used to add error into publicly available gps readings, 
for security reasons. But now errors are not added and geo scientists are 
measuring very small fault motion with gps, but it’s comparing relative motion 
between two stations so wouldn’t apply in your case. I think some serious 
internet searching may be in order.

You must have tried Google Maps with satellite view, to see where it puts you 
relative to your house. You might be interested in this demo of getting google 
maps from Livecode.

http://earthlearningsolutions.org/google-static-maps-demo/

I  made a basic version of this and a hermann (hh), who helped me figure out 
the boundary coordinate calculation, added to it. I think it’s also in the 
livecode repository. It’s a couple of years old, so  

Best,
Bill

William Prothero
https://earthlearningsolutions.org

> On May 5, 2020, at 2:30 AM, Graham Samuel via use-livecode 
>  wrote:
> 
> Thanks Bill for your two messages. I see from the link you gave that the LC 
> system is (as expected) simply a wrapper for the iOS API, and indeed the term 
> “horizontal accuracy” is actually used internally in iOS. So it’s unlikely 
> that LC itself is adding to my problems.
> 
> I don’t have access to an entirely different GPS system - all mine are on 
> iPhones and I’m in lockdown. Google Earth reckons my reference point is at 
> 43.276693, 2.160029. (The curious can see where I live).
> 
> Here is a little test done by simply sitting on a bench in my garden - as far 
> as possible, this is what Google Earth is looking at.
> 
> Another app - “MyAltitude” on my phone. Location 43.2766, 2.1601
> 
> Built-in “Compass” app. Location 43.2766, 2.1600
> 
> My app - successive calls to mobileCurrentLocation a few seconds apart differ 
> only beyond the fourth decimal place, a typical one is 43.276732 (so 43.277), 
> 2.160163 (so 2.1602). During this set of about 20 measurements, horizontal 
> accuracy varied from a minimum of 5 to a maximum of 23, tending to settle 
> down to the lower end - but on other days I’ve seen much higher maxima, 
> certainly above 60 and very occasionally a lot more.
> 
> So the readings agree, at least to three decimal places. Presumably the 
> accuracy is supposed to tell me the amount of wobble to expect, although it’s 
> measured in metres, whereas longitude and latitude are not so 
> straightforward, since the grid covers a spherical earth. Where I live 
> (England and the South of France), the North-South distance of a second of 
> arc (or .000278 in decimal measurement) is about 20 metres, which is perhaps 
> acceptable in short journeys such as walks, so I need to take account of say 
> four or five decimal places if I’m going to hope for reasonable accuracy. 
> This certainly looks feasible - my only real problem therefore is the wild 
> variation in horizontal accuracy that I’m seeing.
> 
> All this makes me think that I should not have a target accuracy, since I may 
> never hit the target and my user will be waiting forever to start his or her 
> trip. I am therefore about to modify the app so it only looks for consistency 
> - as soon as the horizontal accuracy settles down to a value without say more 
> than five percent of variation, I will allow the trip to start. Seems weird 
> but it’s the best I can do. Without access to anyone else’s coding for an iOS 
> app, I can’t see a way to improve on that strategy. Obviously I will now run 
> tests to see how my app compared with others that measure on-the-ground trip 
> distance, particularly for short distances. 
> 
> In case anyone else thinks this is interesting (!), I’ll report back.
> 
> Graham
> 
>> On 4 May 2020, at 16:02, Prothero-ELS via use-livecode 
>>  wrote:
>> 
>> Graham,
>> I would want to be verifying the coordinates with another gps device. I’d 
>> also check it against apps that give lat/Lon. 
>> 
>> Bill
>> 
>> William Prothero
>> https://earthlearningsolutions.org
>> 
 On May 4, 2020, at 5:07 AM, Graham Samuel via use-livecode 
  wrote:
>>> 
>>> I’m using GPS on iPhone using the various commands and functions available 
>>> in LC. Most of this works, but I am having difficulty with the quantity 
>>> “horizontal accuracy”. This can be queried via an array which is returned 
>>> when mobileCurrentLocation() is executed. 
>>> 
>>> Looking at other iOS apps that use GPS and allow one to examine their data, 
>>> I find that in my part of the world, accuracy for them is of the order of 5 
>>> metres: but when I query it using LC I get much higher numbers, indeed some 
>>> of them loo

Re: Has anyone experience of GPS on iPhone?

2020-05-05 Thread Graham Samuel via use-livecode
Thanks Bill for your two messages. I see from the link you gave that the LC 
system is (as expected) simply a wrapper for the iOS API, and indeed the term 
“horizontal accuracy” is actually used internally in iOS. So it’s unlikely that 
LC itself is adding to my problems.

I don’t have access to an entirely different GPS system - all mine are on 
iPhones and I’m in lockdown. Google Earth reckons my reference point is at 
43.276693, 2.160029. (The curious can see where I live).

Here is a little test done by simply sitting on a bench in my garden - as far 
as possible, this is what Google Earth is looking at.

Another app - “MyAltitude” on my phone. Location 43.2766, 2.1601

Built-in “Compass” app. Location 43.2766, 2.1600

My app - successive calls to mobileCurrentLocation a few seconds apart differ 
only beyond the fourth decimal place, a typical one is 43.276732 (so 43.277), 
2.160163 (so 2.1602). During this set of about 20 measurements, horizontal 
accuracy varied from a minimum of 5 to a maximum of 23, tending to settle down 
to the lower end - but on other days I’ve seen much higher maxima, certainly 
above 60 and very occasionally a lot more.

So the readings agree, at least to three decimal places. Presumably the 
accuracy is supposed to tell me the amount of wobble to expect, although it’s 
measured in metres, whereas longitude and latitude are not so straightforward, 
since the grid covers a spherical earth. Where I live (England and the South of 
France), the North-South distance of a second of arc (or .000278 in decimal 
measurement) is about 20 metres, which is perhaps acceptable in short journeys 
such as walks, so I need to take account of say four or five decimal places if 
I’m going to hope for reasonable accuracy. This certainly looks feasible - my 
only real problem therefore is the wild variation in horizontal accuracy that 
I’m seeing.

All this makes me think that I should not have a target accuracy, since I may 
never hit the target and my user will be waiting forever to start his or her 
trip. I am therefore about to modify the app so it only looks for consistency - 
as soon as the horizontal accuracy settles down to a value without say more 
than five percent of variation, I will allow the trip to start. Seems weird but 
it’s the best I can do. Without access to anyone else’s coding for an iOS app, 
I can’t see a way to improve on that strategy. Obviously I will now run tests 
to see how my app compared with others that measure on-the-ground trip 
distance, particularly for short distances. 

In case anyone else thinks this is interesting (!), I’ll report back.

Graham

> On 4 May 2020, at 16:02, Prothero-ELS via use-livecode 
>  wrote:
> 
> Graham,
> I would want to be verifying the coordinates with another gps device. I’d 
> also check it against apps that give lat/Lon. 
> 
> Bill
> 
> William Prothero
> https://earthlearningsolutions.org
> 
>> On May 4, 2020, at 5:07 AM, Graham Samuel via use-livecode 
>>  wrote:
>> 
>> I’m using GPS on iPhone using the various commands and functions available 
>> in LC. Most of this works, but I am having difficulty with the quantity 
>> “horizontal accuracy”. This can be queried via an array which is returned 
>> when mobileCurrentLocation() is executed. 
>> 
>> Looking at other iOS apps that use GPS and allow one to examine their data, 
>> I find that in my part of the world, accuracy for them is of the order of 5 
>> metres: but when I query it using LC I get much higher numbers, indeed some 
>> of them look like nonsense, being hundreds of metres!
>> 
>> I am aware that it takes time for a GPS signal to settle down after 
>> mobileStartTrackingSensor “location” has been called, but even if I script 
>> the examination of accuracy to wait for it to settle down (I look for a run 
>> of similar or identical readings against a ‘reasonable’ criterion, such as 5 
>> metres), it still sometimes settles on very large numbers comparatively 
>> speaking, for example it might stabilise at 65 metres. With that level of 
>> inaccuracy any cumulative use, as in working out the number of kilometres in 
>> a trip, would not be reliable.
>> 
>> I wonder if my expectation is wrong, or if there is something different 
>> about LC’s encapsulation of these iOS outputs, or if there is some other 
>> explanation.
>> 
>> In the short term, I’m simply going to have to relax my search for a 
>> reasonable accuracy of the order of 5 metres, and just go for the first run 
>> of stable readings. But I would love to hear any further insight from anyone 
>> who’s already tried it.
>> 
>> Graham
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com

RE: Has anyone experience of GPS on iPhone?

2020-05-04 Thread Ralph DiMola via use-livecode
Graham,

Try a GPS status app from the iStore. If you are inside or have RFI the device 
will fall back to cellular/WIFI location data. If a GPS status app also shows 
poor accuracy this could be your problem.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
Graham Samuel via use-livecode
Sent: Monday, May 04, 2020 11:37 AM
To: How to use LiveCode
Cc: Graham Samuel
Subject: Re: Has anyone experience of GPS on iPhone?

Thanks Ralph. To answer your questions:

1. I left the mobileStartTrackingSensor to the default second parameter, i.e. I 
didn’t put anything. The LC dictionary says that the default value is false 
which means

> readings are determined using accurate (but power consuming) sources such as 
> GPS

of course I could put in “false” explicitly. But looking at the actual output 
data from the GPS functions, I think it’s evident that the GPS is actually 
being used. Nevertheless I will try including “false”.

2.  Yes, I do require GPS as well as Location Services

So, those bits seem OK.

Still thinking about it, obviously.

Graham

> On 4 May 2020, at 16:22, Ralph DiMola via use-livecode 
>  wrote:
> 
> 1) Did you set the second parameter of mobileStartTrackingSensor to "false"?
> 2) Did you require "GPS" as well as "Location Services" in the standalone 
> settings? If you don’t tick GPS then the GPS chip will not be used and you 
> will get rough location readings.
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> 
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf 
> Of Graham Samuel via use-livecode
> Sent: Monday, May 04, 2020 8:07 AM
> To: How to use LiveCode
> Cc: Graham Samuel
> Subject: Has anyone experience of GPS on iPhone?
> 
> I’m using GPS on iPhone using the various commands and functions available in 
> LC. Most of this works, but I am having difficulty with the quantity 
> “horizontal accuracy”. This can be queried via an array which is returned 
> when mobileCurrentLocation() is executed. 
> 
> Looking at other iOS apps that use GPS and allow one to examine their data, I 
> find that in my part of the world, accuracy for them is of the order of 5 
> metres: but when I query it using LC I get much higher numbers, indeed some 
> of them look like nonsense, being hundreds of metres!
> 
> I am aware that it takes time for a GPS signal to settle down after 
> mobileStartTrackingSensor “location” has been called, but even if I script 
> the examination of accuracy to wait for it to settle down (I look for a run 
> of similar or identical readings against a ‘reasonable’ criterion, such as 5 
> metres), it still sometimes settles on very large numbers comparatively 
> speaking, for example it might stabilise at 65 metres. With that level of 
> inaccuracy any cumulative use, as in working out the number of kilometres in 
> a trip, would not be reliable.
> 
> I wonder if my expectation is wrong, or if there is something different about 
> LC’s encapsulation of these iOS outputs, or if there is some other 
> explanation.
> 
> In the short term, I’m simply going to have to relax my search for a 
> reasonable accuracy of the order of 5 metres, and just go for the first run 
> of stable readings. But I would love to hear any further insight from anyone 
> who’s already tried it.
> 
> Graham
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Has anyone experience of GPS on iPhone?

2020-05-04 Thread Graham Samuel via use-livecode
Thanks Ralph. To answer your questions:

1. I left the mobileStartTrackingSensor to the default second parameter, i.e. I 
didn’t put anything. The LC dictionary says that the default value is false 
which means

> readings are determined using accurate (but power consuming) sources such as 
> GPS

of course I could put in “false” explicitly. But looking at the actual output 
data from the GPS functions, I think it’s evident that the GPS is actually 
being used. Nevertheless I will try including “false”.

2.  Yes, I do require GPS as well as Location Services

So, those bits seem OK.

Still thinking about it, obviously.

Graham

> On 4 May 2020, at 16:22, Ralph DiMola via use-livecode 
>  wrote:
> 
> 1) Did you set the second parameter of mobileStartTrackingSensor to "false"?
> 2) Did you require "GPS" as well as "Location Services" in the standalone 
> settings? If you don’t tick GPS then the GPS chip will not be used and you 
> will get rough location readings.
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> 
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf 
> Of Graham Samuel via use-livecode
> Sent: Monday, May 04, 2020 8:07 AM
> To: How to use LiveCode
> Cc: Graham Samuel
> Subject: Has anyone experience of GPS on iPhone?
> 
> I’m using GPS on iPhone using the various commands and functions available in 
> LC. Most of this works, but I am having difficulty with the quantity 
> “horizontal accuracy”. This can be queried via an array which is returned 
> when mobileCurrentLocation() is executed. 
> 
> Looking at other iOS apps that use GPS and allow one to examine their data, I 
> find that in my part of the world, accuracy for them is of the order of 5 
> metres: but when I query it using LC I get much higher numbers, indeed some 
> of them look like nonsense, being hundreds of metres!
> 
> I am aware that it takes time for a GPS signal to settle down after 
> mobileStartTrackingSensor “location” has been called, but even if I script 
> the examination of accuracy to wait for it to settle down (I look for a run 
> of similar or identical readings against a ‘reasonable’ criterion, such as 5 
> metres), it still sometimes settles on very large numbers comparatively 
> speaking, for example it might stabilise at 65 metres. With that level of 
> inaccuracy any cumulative use, as in working out the number of kilometres in 
> a trip, would not be reliable.
> 
> I wonder if my expectation is wrong, or if there is something different about 
> LC’s encapsulation of these iOS outputs, or if there is some other 
> explanation.
> 
> In the short term, I’m simply going to have to relax my search for a 
> reasonable accuracy of the order of 5 metres, and just go for the first run 
> of stable readings. But I would love to hear any further insight from anyone 
> who’s already tried it.
> 
> Graham
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Has anyone experience of GPS on iPhone?

2020-05-04 Thread Prothero-ELS via use-livecode
Graham,
You may be way beyond this, but I did a bit of googling and this link looked 
relevant.

https://www.smaato.com/blog/optimize-your-location-data-accuracy/

Best,
Bill

William Prothero
https://earthlearningsolutions.org

> On May 4, 2020, at 5:07 AM, Graham Samuel via use-livecode 
>  wrote:
> 
> I’m using GPS on iPhone using the various commands and functions available 
> in LC. Most of this works, but I am having difficulty with the quantity 
> “horizontal accuracy”. This can be queried via an array which is returned 
> when mobileCurrentLocation() is executed. 
> 
> Looking at other iOS apps that use GPS and allow one to examine their data, I 
> find that in my part of the world, accuracy for them is of the order of 5 
> metres: but when I query it using LC I get much higher numbers, indeed some 
> of them look like nonsense, being hundreds of metres!
> 
> I am aware that it takes time for a GPS signal to settle down after 
> mobileStartTrackingSensor “location” has been called, but even if I script 
> the examination of accuracy to wait for it to settle down (I look for a run 
> of similar or identical readings against a ‘reasonable’ criterion, such as 5 
> metres), it still sometimes settles on very large numbers comparatively 
> speaking, for example it might stabilise at 65 metres. With that level of 
> inaccuracy any cumulative use, as in working out the number of kilometres in 
> a trip, would not be reliable.
> 
> I wonder if my expectation is wrong, or if there is something different about 
> LC’s encapsulation of these iOS outputs, or if there is some other 
> explanation.
> 
> In the short term, I’m simply going to have to relax my search for a 
> reasonable accuracy of the order of 5 metres, and just go for the first run 
> of stable readings. But I would love to hear any further insight from anyone 
> who’s already tried it.
> 
> Graham
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Has anyone experience of GPS on iPhone?

2020-05-04 Thread Ralph DiMola via use-livecode
1) Did you set the second parameter of mobileStartTrackingSensor to "false"?
2) Did you require "GPS" as well as "Location Services" in the standalone 
settings? If you don’t tick GPS then the GPS chip will not be used and you will 
get rough location readings.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
Graham Samuel via use-livecode
Sent: Monday, May 04, 2020 8:07 AM
To: How to use LiveCode
Cc: Graham Samuel
Subject: Has anyone experience of GPS on iPhone?

I’m using GPS on iPhone using the various commands and functions available in 
LC. Most of this works, but I am having difficulty with the quantity 
“horizontal accuracy”. This can be queried via an array which is returned when 
mobileCurrentLocation() is executed. 

Looking at other iOS apps that use GPS and allow one to examine their data, I 
find that in my part of the world, accuracy for them is of the order of 5 
metres: but when I query it using LC I get much higher numbers, indeed some of 
them look like nonsense, being hundreds of metres!

I am aware that it takes time for a GPS signal to settle down after 
mobileStartTrackingSensor “location” has been called, but even if I script the 
examination of accuracy to wait for it to settle down (I look for a run of 
similar or identical readings against a ‘reasonable’ criterion, such as 5 
metres), it still sometimes settles on very large numbers comparatively 
speaking, for example it might stabilise at 65 metres. With that level of 
inaccuracy any cumulative use, as in working out the number of kilometres in a 
trip, would not be reliable.

I wonder if my expectation is wrong, or if there is something different about 
LC’s encapsulation of these iOS outputs, or if there is some other explanation.

In the short term, I’m simply going to have to relax my search for a reasonable 
accuracy of the order of 5 metres, and just go for the first run of stable 
readings. But I would love to hear any further insight from anyone who’s 
already tried it.

Graham
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Has anyone experience of GPS on iPhone?

2020-05-04 Thread Prothero-ELS via use-livecode
Graham,
I would want to be verifying the coordinates with another gps device. I’d also 
check it against apps that give lat/Lon. 

Bill

William Prothero
https://earthlearningsolutions.org

> On May 4, 2020, at 5:07 AM, Graham Samuel via use-livecode 
>  wrote:
> 
> I’m using GPS on iPhone using the various commands and functions available 
> in LC. Most of this works, but I am having difficulty with the quantity 
> “horizontal accuracy”. This can be queried via an array which is returned 
> when mobileCurrentLocation() is executed. 
> 
> Looking at other iOS apps that use GPS and allow one to examine their data, I 
> find that in my part of the world, accuracy for them is of the order of 5 
> metres: but when I query it using LC I get much higher numbers, indeed some 
> of them look like nonsense, being hundreds of metres!
> 
> I am aware that it takes time for a GPS signal to settle down after 
> mobileStartTrackingSensor “location” has been called, but even if I script 
> the examination of accuracy to wait for it to settle down (I look for a run 
> of similar or identical readings against a ‘reasonable’ criterion, such as 5 
> metres), it still sometimes settles on very large numbers comparatively 
> speaking, for example it might stabilise at 65 metres. With that level of 
> inaccuracy any cumulative use, as in working out the number of kilometres in 
> a trip, would not be reliable.
> 
> I wonder if my expectation is wrong, or if there is something different about 
> LC’s encapsulation of these iOS outputs, or if there is some other 
> explanation.
> 
> In the short term, I’m simply going to have to relax my search for a 
> reasonable accuracy of the order of 5 metres, and just go for the first run 
> of stable readings. But I would love to hear any further insight from anyone 
> who’s already tried it.
> 
> Graham
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Has anyone experience of GPS on iPhone?

2020-05-04 Thread Graham Samuel via use-livecode
I’m using GPS on iPhone using the various commands and functions available in 
LC. Most of this works, but I am having difficulty with the quantity 
“horizontal accuracy”. This can be queried via an array which is returned when 
mobileCurrentLocation() is executed. 

Looking at other iOS apps that use GPS and allow one to examine their data, I 
find that in my part of the world, accuracy for them is of the order of 5 
metres: but when I query it using LC I get much higher numbers, indeed some of 
them look like nonsense, being hundreds of metres!

I am aware that it takes time for a GPS signal to settle down after 
mobileStartTrackingSensor “location” has been called, but even if I script the 
examination of accuracy to wait for it to settle down (I look for a run of 
similar or identical readings against a ‘reasonable’ criterion, such as 5 
metres), it still sometimes settles on very large numbers comparatively 
speaking, for example it might stabilise at 65 metres. With that level of 
inaccuracy any cumulative use, as in working out the number of kilometres in a 
trip, would not be reliable.

I wonder if my expectation is wrong, or if there is something different about 
LC’s encapsulation of these iOS outputs, or if there is some other explanation.

In the short term, I’m simply going to have to relax my search for a reasonable 
accuracy of the order of 5 metres, and just go for the first run of stable 
readings. But I would love to hear any further insight from anyone who’s 
already tried it.

Graham
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode