GPS tips


Location at a given second

Let's say we took a Boeing Dreamliner and discovered the high-tech tinted windows block GPS signals. Or we were on an ordinary plane but our cellphone's GPS hadn't warmed up yet. So where were those suspicious object we photographed?

Our sadly GPS-lacking Exif headers still at least have timestamps.

Yes, there are a lot of programs for putting locations into the Exif, based on a GPS track, written back when cameras didn't have GPS. But today we'll just keep it simple and ask where were we at a given second, 03:25:38Z.

Within a week of the flight some websites offer free of cost track file downloads.

$ t=20221221032538 f=FlightAware_UAL871_KSFO_RCTP_20221220.kml
$ gpsbabel -i kml -f $f \
-x interpolate,time=1 \
-x track,start=$(($t-1)),stop=$t \
-o kml,units=a,points=1,lines=0,track=0 -F out.kml

In the output here's our $t-1 growth-stunted sacrificial throwaway node:

Longitude: -177.421095
Latitude: 51.598699
Altitude: 32001.312 ft
Heading: 358.0
Time: 2022-12-21T03:25:37Z

And here's our data-rich $t node!:

Longitude: -177.425000
Latitude: 51.599380
Altitude: 32001.312 ft
Speed: 545.2 knts
Heading: 285.7
Time: 2022-12-21T03:25:38Z


Let's talk a moment about that "growth-stunted sacrificial throwaway" node.

  1. First look at that ugly "Heading: 358.0". Where did they (gpsbabel) ever come up with that? No don't try to explain it. Just get rid of it, like what happened to Speed. Gone. Makes sense, because you are on the origin node any you need a 2nd node before you can calculate Heading, and Speed.

  2. But wait, we, before using start=, stop=, were already far along in the track, so even at the first node of our two node segment, that info could be provided. And indeed, we wouldn't need our first "growth-stunted sacrificial throwaway" $t-1 node in the first place.

Probably all fixed now.

-o exif; sub-second results.

積丹尼 Dan Jacobson

Last modified: 2023-03-12 00:03:53 UTC