Coordinates readout correction calculation, any useful function I may have overlooked?

50 views
Skip to first unread message

Bushmills

unread,
Jul 7, 2021, 6:58:18 PM7/7/21
to Automate
For a geotagging flow, I intend to improve coordinates accuracy: As the "Get location" block can provide position timestamp - as time between two coordinates may be a second, almost 28 meters at a velocity of 100km/h -, and flow trigger time is known too, as are velocity and bearing, I ought to be able to correct coordinates by cancelling out the motion portion resulting from (positive or negative) "lag" (the time difference between obtained coordinates and flow trigger time). The provided functions, as far as related and found (distance and bearing), don't appear to be helpful for my intended coordinates correction. As involved distances are small, I can deal with coordinates in a plane, no need to calculate on spheres or even ellipsoids, which simplifies the operation enormously. Still, it appears that I must calculate error distance (from lag and velocity), use sin and cos on bearing to yield horizontal and vertical motion portions, scale those with error distance, then by earth circumference for conversion to degrees, and finally add those corrective components to obtained coordinates, in order to obtain the original (i.e. corrected) coordinates ...  Really? Didn't I simply miss a helpful function to shortcut this calculation (like, "inverting" the provided bearing or distance functions)?
The flow for which this correction is meant is https://llamalab.com/automate/community/flows/39863

Henrik "The Developer" Lindqvist

unread,
Jul 7, 2021, 9:55:05 PM7/7/21
to Automate
Automate primarily expose what Android already implement, both the bearing and distance functions rely on:

It doesn't return an "error distance".

Please submit a feature request if Automate lacks a useful feature/function.

Bushmills

unread,
Jul 12, 2021, 4:11:36 PM7/12/21
to Automate
I've put the correction calculation into an example flow at https://llamalab.com/automate/community/flows/39930 -
feel free to incorporate it into your "Get location" block. Double Checking the calculation shows that the discrepancy between the result of "distance(lat1, lon1, lat2, lon2)" and "abs(velocity*(time1-time2)"  (with one of the sets of coordinates in distance being the corrected coordinates, and time1,  time2 referring to coordinates time stamp and time executing the "Get location" action block) to be consistently below one millimeter.
Reply all
Reply to author
Forward
0 new messages