ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: xerasy on October 16, 2017, 01:09:44 PM

Title: Change gps latitude
Post by: xerasy on October 16, 2017, 01:09:44 PM
Hello,is there a way to quickly add 1-2 degrees gps ? I'm trying this :
1. read gps .\exiftool -gpslatitude -gpslongitude 2.jpg
Get example :
GPS Latitude : 46 deg 50' 14.06" N
GPS Longitude : 29 deg 39' 49.46" E


2. Now you need to change it to degrees and write back
.\exiftool -GPSLongitudeRef=E -GPSLongitude=47 -GPSLatitudeRef=N GPSLatitude=29 1.jpg

but only recorded the first numbers and how to add 50, 14,06, 39, 49.46 ?
because in properties there is all the numbers
(http://joxi.ru/brR8gjxFJDp6p2.jpg)
Title: Re: Change gps latitude
Post by: Phil Harvey on October 16, 2017, 01:19:20 PM
You could do this to add 2 degrees to longitude:

exiftool "-gpslongitude<${gpslongitude#;$_+=2}" FILE

Add the -n option when reading to get decimal degrees.

- Phil
Title: Re: Change gps latitude
Post by: xerasy on October 16, 2017, 01:32:38 PM


Quote from: Phil Harvey on October 16, 2017, 01:19:20 PM
You could do this to add 2 degrees to longitude:

exiftool "-gpslongitude<${gpslongitude#;$_+=2}" FILE

Add the -n option when reading to get decimal degrees.

- Phil
i run in cmd
.\exiftool "-gpslongitude<${gpslongitude#;$_+=2}" 2.jpg

Get Warning

Warning: [minor] Unrecognized MakerNotes - 2.jpg
Warning: No writable tags set from 2.jpg
    0 image files updated
    1 image files unchanged

and doesnt work((, longitude still the same[/s]



-- it doesnt work in powershell, but in standart cmd all ok !! thank you
Title: Re: Change gps latitude
Post by: StarGeek on October 16, 2017, 01:53:43 PM
Are you on Mac/Linux?  If so, you need to change the double quotes to single quotes.

exiftool '-gpslongitude<${gpslongitude#;$_+=2}' 2.jpg

Another thing to take note of is that if the directional reference is South or West, then adding 2 degrees will reduce the number because South/West numbers are negative.  To make the coordinate further South/West, you need to subtract.
C:\>exiftool -GPSLongitude -GPSLongitude# y:\!temp\Test3.jpg
GPS Longitude                   : 70 deg 2' 40.20" W
GPS Longitude                   : -70.0445

C:\>exiftool -P -overwrite_original "-gpslongitude<${gpslongitude#;$_+=2}" y:\!temp\Test3.jpg
    1 image files updated

C:\>exiftool -GPSLongitude -GPSLongitude# y:\!temp\Test3.jpg
GPS Longitude                   : 68 deg 2' 40.20" W
GPS Longitude                   : -68.0445

C:\>exiftool -P -overwrite_original "-gpslongitude<${gpslongitude#;$_-=2}" y:\!temp\Test3.jpg
    1 image files updated

C:\>exiftool -GPSLongitude -GPSLongitude# y:\!temp\Test3.jpg
GPS Longitude                   : 70 deg 2' 40.20" W
GPS Longitude                   : -70.0445
Title: Re: Change gps latitude
Post by: Phil Harvey on October 17, 2017, 09:53:18 AM
I've just released ExifTool 10.64.  This version improves the shift feature (-TAG+=VAL) to allow GPS coordinates to be shifted, which can simplify your command.  For example, to add 1 degree to latitude and subtract 2.5 degrees from longitude:

-exiftool -gpslatitude+=1 -gpslongitude+=-2.5 FILE

- Phil