How to format the GPS output to show N | S | E | W

Started by tonyredhead, November 19, 2015, 11:05:58 PM

Previous topic - Next topic

tonyredhead

Hi,

I'm a long time user of ExifTools and pyExifToolsGui but with the recent update to El Capitan I cannot get pyExifToolsGui to speak to ExifTools. As a result I've started using the Terminal on the Mac to write the metadata to my images. However I'm coming up with a problem that I've tried to solve with no luck and I'm hoping the more experienced users here will be able to help me.

I'm trying to add GPS Longitude and Latitude to a .jpg image using the following code;

exiftool -GPSLatitude=-7.798820 -GPSLongitude=110.365683 -UsePanoramaViewer=True -ProjectionType=equirectangular -PoseHeadingDegrees=0 -CroppedAreaLeftPixels=0 -FullPanoWidthPixels=6000 -CroppedAreaImageHeightPixels=3000 -FullPanoHeightPixels=3000 -CroppedAreaImageWidthPixels=6000 -CroppedAreaTopPixels=0 -LargestValidInteriorRectHeight=3000 Mowani-Sunset.jpg

What I end up with is this;

0x0002 GPS Latitude : 7 deg 47' 55.75"
0x0004 GPS Longitude : 110 deg 21' 56.46"
GPS Position  : 7 deg 47' 55.75", 110 deg 21' 56.46"


When what I really need is this with the "S" and "E" following the degrees;

0x0002 GPS Latitude : 7 deg 47' 55.75" S
0x0004 GPS Longitude : 110 deg 21' 56.46" E
GPS Position  : 7 deg 47' 55.75" S, 110 deg 21' 56.46" E


Any help or direction would be appreciated.

Tony

StarGeek

#1
The problem has to do with the tags you're writing.  GPSLatitude and GPSLongitude, by default, are written to the EXIF block.  The trouble is that in the EXIF block, those values are unsigned and in order to decode whether the value is North/South or East/West requires that you also write the GPSLatitudeRef and GPSLongitudeRef values. 

The alternative would be to write to XMP:GPSLatitude and XMP:GPSLongitude.  Then, if you need the EXIF gps tags written to, you could use the xmp2gps.args file from full distribution to copy the Ref values.
"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

tonyredhead

Thanks StarGeek,

I'm not entirely sure I know what to do but I'll do some investigating and see if I can figure out what you mean by, "use the xmp2gps.ars".

cheers,

Tony

Phil Harvey

Hi Tony,

Add this to your command when writing the coordinates: -gpslatituderef=S -gpslongituderef=E

See FAQ 14 for some help with this.

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

tonyredhead

Hi Phil,

Thanks for that it worked a treat. I also managed to add a description using -description 'name here'. Google Street View app on Android and iOS recognises all of the metadata and publishes the images perfectly to Google Maps.

Thanks again to both you and StarGeek for helping me out.

Tony