Sign not included for GPSLatitude and GPSLongitude tags using -n option

Started by mkidd, December 07, 2014, 07:17:06 PM

Previous topic - Next topic

mkidd

I can't seem to get EXIFtool to dump GPSLatitude and GPSLongitude as signed values. My reading of the documentation, specifically the "-c FMT (-coordFormat)" section, is that using the -n option will extract coordinates as signed decimal degrees. But this doesn't seem to happen:

exiftool -n -gps:GPSLatitude -gps:GPSLongitude test.jpg
GPS Latitude                    : 32.7894995499972
GPS Longitude                   : 116.163994550106

I'm sure longitude is really negative because (1) GeoSetter shows it as such, (2) Google Panoramio positions the uploaded image correctly, and (3) exiftool will cough up W if GPSLongitudeRef if requested, i.e.

exiftool -T -n -gps:GPSLatitude -gps:GPSLongitude -gps:GPSLongitudeRef test.jpg
32.7894995499972        116.163994550106        W

It also seems like I should able to get a signed output using -c "%+.6f" where the + in the format specifier is supposed to print a signed coordinate. But this does not seem to work either:

exiftool -T -c "%+.6f" -gps:GPSLatitude -gps:GPSLongitude -gps:GPSLongitudeRef test.jpg
32.789500       116.163995      West

Am I misreading the documentation?

I see the issue for version 9.77 (also 9.69).

StarGeek

It looks like the GPS numbers are unsigned and use the GPS(Latitude|Longitude)Ref tags to figure out the sign.  The composite tags will take care of this for you.

c:\>exiftool -G1 -a -n -GPSLongitude x:\!temp\Test.jpg
[GPS]           GPS Longitude                   : 116.072798333333
[Composite]     GPS Longitude                   : -116.072798333333
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Hayo Baan

StarGeek is right. The numbers are to their respective reference. In theory you could even have a negative longitude on W meaning it is actually on E ;).  Use the composite tags to get what you expect.

Cheers,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

I don't understand the problem:

> exiftool ~/Desktop/test.jpg -gpslatitude -gpslongitude -n -G1
[Composite]     GPS Latitude                    : 32.7894995499972
[Composite]     GPS Longitude                   : -116.163994550106


These Composite tags are shown by default, and get their sign from the GPS reference direction as Hayo mentioned.

- 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 ($).

StarGeek

Quote from: mkidd on December 07, 2014, 07:17:06 PM
exiftool -n -gps:GPSLatitude -gps:GPSLongitude test.jpg
GPS Latitude                    : 32.7894995499972
GPS Longitude                   : 116.163994550106

mkidd is specifying the GPS block rather than using the defaults.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

...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 ($).