Nowadays I often track walks and similar when I am out touristing. I did not do so back in the day though. Curious to retrace my steps on some older trip, I realised my pictures should have some GPS data. Apparently getting that data out into a GPX file is a solved problem in exiftool. I will assume you already have and know what exiftool is. Primer: lets you work with photo metadata.

For this solution to work, you will need the gpx.fmt file that comes with exiftool. You can find this file in their repo in case it is not included in your local exiftool installation.

Then you just do something like

exiftool -p gpx.fmt -d %Y-%m-%dT%H:%M:%SZ *jpg > out.gpx

Their man page says to use dir to specify which files to look at, but then the ordering was all over the place. Not quite what you want with a GPX trace. Using *jpg uses your shell’s ordering, which will match up normally as your phone/camera probably names everything in a datetime similar to ISO. Makes for easy sorting.

Now you have a GPX file using all the GPS information present in your photos. Handy for an overview of how you went through a city.