Change gps latitude

Started by xerasy, October 16, 2017, 01:09:44 PM

Previous topic - Next topic

xerasy

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

xerasy

#2


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

StarGeek

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
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).