Map + GPS Locator

Hi to all,
I am new on Thunkable
I have found something strange for me, I am developing an app just to understand how Thunkable works,
I use the Map and the GPS Locator, with the GetCurrentLocation I use the latitude and the longitude to show with a Marker my position in a map.
I saw (in my case) that the position is not correct and if I physically move of 30-40 meters the coordinates does not change.
I solved (but I don’t know why) setting True: ShowsUserLocation, ShowsMyLocationButton, FollowsUserLocation.
One of these solved my problem.
About the documentation I did not find what means in the GPS Locator , the Timeout and Maximum Age
Thank You
Best Regards
Marco

Hi,

Timeout : is a positive value that indicates the maximum time the device is allowed to return a position.

MaximumAge : is a positive value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. In other words, how old can cached locations be before I should start getting the current location to return.

Thank You for yuor reply.
Do You have a link where to find these informations?
I did not find in Thunkable docs
Best Regards
Marco

The documentation does not have this information. It taken from here.

http://droidscript.ru/main/statyi/thunkableios_objects.php#locationsensor

The accuracy of your location depends on the GPS reception, and the quality of the measure is very twitchy.
I am also currently investigating the locator function and while not even moving at all, fond the reported “you are here” latitude and longitude to randomly jump as much as 30 m away from my actual position. Rarely do I ever get a reading that is less than 8 m away, despite the claim from an independent GPS tracking app reportedly boasting a 3D fix with a +/-4 accuracy (by the way and for the record, if I plug-in to recharge my phone, the signal strength of the best satellite in view, as reported by that app, instantaneously drops from 34 to 28).

Bonjour Mr. Goudreault,
I tested the GPS Locator using an Huawei P8 with Android 6, I saw that if I use the GPS Locator the coordinates aren’t correct and do not change. If I use Google Maps the data is correct so I suppose is not an hardware problem or quality reception.
And if I set True: ShowsUserLocation, ShowsMyLocationButton, FollowsUserLocation. on the Map Component everything works fine, I don’t know how they interact with the GPS Locator.
Best Regards
Marco

GPS will be jumpy because it relies on always moving satellites coming and getting out of view, with their signal getting randomly delayed by the ionosphere. The way to improve on this is to have a second GPS signal at a different frequency, which is affected in a different manner that the primary signal and allows to compute the delay effect and to compensate for it. However, this second signal is the scrambled military one, so your GPS unit cannot decode it.
I understand that Google Map relies on WiFi signals from various networks, the location of those being known since WiFi bases are usually stationary, and based on the strength of each, can triangulate your position with much better accuracy. I presume if you are in the middle of a forest, far from any wifi network, then it will fall back on the GPS.
But typically, when both “services” are available, there may be several metres discrepancy between the location reported by each.

It is a lot easier than you think to solve this problem: The biggest errors are when the location is not changing. Set up a simple filter on your loc_OnChange(data) that will average the location’s latitude and longitude until and unless the speed reported by the data object is greater than or equal to about 0.75. When that limit is exceeded, further require that the speed remain over that limit for two occurrences. If it does, restart your average. This subtle change reduced the jittering and brought the position to within 2 to 3 meters of the actual location. A rudimentary field test should acceptable sensitivity to actual movement or changes in the location.

 // use average lat lon while stationary (speed approx 0)
if(data.speed <= 0.80)
{
    MaverickCtr = 0;
    
    samples    += 1;
    SumLongitude += data.longitude;
    SumLatitude += data.latitude;
}
else
{
    MaverickCtr += 1;
    
    if(MaverickCtr >= 2)
    {
        samples = 1;
        SumLongitude = data.longitude;
        SumLatitude = data.latitude;
    }
    else
    {
        samples    += 1;
        SumLongitude += data.longitude;
        SumLatitude += data.latitude;
    }
}

Longitudebar = SumLongitude/samples;
Latitudebar = SumLatitude/samples;

This speed number is not a ‘magic’ number but the average distance reported by 62 of these spurious speed change occurences out of a thousand gps readings when there was not an actual change in location.

I hope that this helps you.

1 Like