ExifTool Forum

General => Metadata => Topic started by: Ry on August 06, 2023, 06:47:43 AM

Title: Geocoding photos based on average coordinates
Post by: Ry on August 06, 2023, 06:47:43 AM
Hi all,

I just made a little workflow that uses exiftool for geocoding photos with missing coordinates and sharing here in case it's helpful to anyone. It's about as elegant as a US president but it does the job.

It's useful if you have:

For each folder, it will calculate the average coordinates for images with geodata, then write to those without.

But if you want to fire everything at once there's a third script that will run the others in for-loops for all folders as long as they're in the same parent directory.

More details and files available at the github repo (https://github.com/rylanshearn/geopica).

Any feedback would be appreciated - I realise a lot of this is probably ignoring the functionality of exiftool and the code could be reduced significantly!

PH Edit: Fixed links to point to scripts on github.
Title: Re: Geocoding photos based on average coordinates
Post by: StarGeek on August 06, 2023, 11:54:11 PM
Not trying to dismiss your hard work, but with exiftool, you can create a geotrack out of the images that have coordinates.  See Inverse Geotagging (https://exiftool.org/geotag.html#Inverse).  While it's more common to see this operation used to extract a track from a video, it can also be used on a set of images.

Then you can use the regular Geotag command with the newly created geotrack.
Title: Re: Geocoding photos based on average coordinates
Post by: Ry on August 08, 2023, 01:02:17 AM
That's really cool thanks for pointing that out. Exiftool continues to amaze!

I couldn't see how inverse geotagging handles multiple input coordinates in this case. Does it also use a mid-point or average?
Title: Re: Geocoding photos based on average coordinates
Post by: StarGeek on August 08, 2023, 02:15:05 PM
I don't know all the details, Phil would have to explain exactly what's happening.  But from the top of the Geotagging page
QuoteThe GPS track log file is loaded, and linear interpolation is used to determine the GPS position at the time of the image
Title: Re: Geocoding photos based on average coordinates
Post by: Phil Harvey on August 08, 2023, 02:52:14 PM
The interpolation is done to the time of the image between the GPS fixes with the nearest timestamps on either side of the image time.

- Phil