Coordinates correction: compensate uniform motion

by Bushmills

Version 2 (September 9, 2021)

Download (65 downloads)

While the "Get location" action may yield a more or less accurate location, that location may not coincide with the location you asked for. Reason is that the returned coordinates may have been determined already before you asked for them, or later if they still need to be determined.
When you move, your position will change, or has already changed, relative to the reported coordinates. At a velocity of 100 km/h, this error distance may be almost 28 metres if time difference between the moment you asked for coordinates and time stamp of returned coordinates is a mere second.

Luckily all data to correct coordinates in case of uniform motion is made available: velocity, bearing, latitude, time stamp of returned coordinates, and the time of requesting coordinates. This flow corrects latitude and longitude, as received by the "Get location" block, and takes the above variables into account to calculate ahead or back to the location at the time of "Get location" action block execution.
The corrected coordinates are returned as variables reallat and reallon. Remember, uniform motion assumed, no (de-)acceleration taken into account. For simplicity is Earth regarded a perfect sphere with a circumference of 40000 km. Also, this flow won't and can't compensate coordinates inaccuracies, as produced by measurement and system.

Reason for writing this correction calculation was mostly to improve coordinates readout for this OpenStreetMap tagging flow at
https://llamalab.com/automate/community/flows/39863
Enjoy.