I have some photos which contain my precise GPS location. I'd like to reduce the accuracy of the location in the images.
Effectively, I want to go from 51.123456,0.987654 to 51.12,0.98
From reading the forum, I see I can use exiftool -gpslatitude+=1 -gpslongitude+=-2.5 file.jpg to adjust the co-ordinates. But I can't seem to find a way to have fewer decimal places.
I could use -GPSLongitudeRef=E -GPSLongitude=0.98 -GPSLatitudeRef=N -GPSLatitude=51.12 - but I'd have to calculate that manually for each photo.
If I use exiftool -c "%.2f degrees" file.jpg, I get back the precision I want - but I don't know how to take that value and write it back to the file.
Any help would be greatly appreciated.
I'm using exiftool 11.88-1 on Ubuntu.
Try this
exiftool -c "%.2f" -TagsFromFile @ -GPSLatitude -GPSLongitude file.jpg
This sets the coordinate format to two decimal places as you discovered and copies the new values back into GPSLatitude/GPSLongitude. The word "degrees" isn't needed for this copy operation.
Example output:
C:\>exiftool -g1 -a -s -gpsl*# y:\!temp\Test4.jpg
---- GPS ----
GPSLatitudeRef : N
GPSLatitude : 40.6892
GPSLongitudeRef : W
GPSLongitude : 74.0445
---- Composite ----
GPSLatitude : 40.6892
GPSLongitude : -74.0445
C:\>exiftool -P -overwrite_original -c "%.2f" -TagsFromFile @ -GPSL* y:\!temp\Test4.jpg
1 image files updated
C:\>exiftool -g1 -a -s -gpsl*# y:\!temp\Test4.jpg
---- GPS ----
GPSLatitudeRef : N
GPSLatitude : 40.69
GPSLongitudeRef : W
GPSLongitude : 74.04
---- Composite ----
GPSLatitude : 40.69
GPSLongitude : -74.04
Brilliant! Thanks mate.