News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Issue adding GPS lat/long such that location is available on iPhone.

Started by PeterC, November 12, 2019, 07:23:57 AM

Previous topic - Next topic

PeterC

I am trying to added gps data to mp4 and mov files so that locations are available on my iphone.

C:\Users\Peter>"c:\users\peter\appdata\roaming\geosetter\tools\exiftool.exe" -gpslatitude=42.5 -gpslongitude=42.5 "C:Photos\test\test2.mp4"
    1 image files updated

The command seems to run but the location is not visible in photos on my iPhone.   the latitude and longitude are not showing up in the [Composite] but are showing  up under [XMP-exif].   Is that the reason the Iphone is not recognizing the location?   


"c:\users\peter\appdata\roaming\geosetter\tools\exiftool.exe" -a -G1 -s "C:\Photos\test\test2.mp4"
[ExifTool]      ExifToolVersion                 : 11.75
[System]        FileName                        : test2.mp4
...
[XMP-x]         XMPToolkit                      : Image::ExifTool 11.75
[XMP-exif]      GPSLatitude                     : 42 deg 30' 0.00" N
[XMP-exif]      GPSLongitude                    : 42 deg 30' 0.00" E
...
[Composite]     GPSLatitudeRef                  : North
[Composite]     GPSLongitudeRef                 : East
[Composite]     GPSPosition                     : 42 deg 30' 0.00" N, 42 deg 30' 0.00" E


C:\Users\Peter>"c:\users\peter\appdata\roaming\geosetter\tools\exiftool.exe" -composite:gpslatitude="42.5" -composite:gpslongitude="42.5" "C:\Photos\test\test2.mp4"
Warning: Sorry, composite:GPSLatitude doesn't exist or isn't writable
Warning: Sorry, composite:GPSLongitude doesn't exist or isn't writable
Nothing to do.

C:\Users\Peter>"c:\users\peter\appdata\roaming\geosetter\tools\exiftool.exe" -quicktime:gpslatitude="42.5" -quicktime:gpslongitude="42.5" "C:\Photos\test\test2.mp4"
Warning: Sorry, quicktime:GPSLatitude doesn't exist or isn't writable
Warning: Sorry, quicktime:GPSLongitude doesn't exist or isn't writable
Nothing to do.


Thanks in advance

Phil Harvey

Hi Peter,

First, make sure you are using ExifTool 11.69 or later.

Then, I think that Apple prefers the GPS coordinates for MOV and MP4 videos in Keys:GPSCoordinates, so try this:

"c:\users\peter\appdata\roaming\geosetter\tools\exiftool.exe" -keys:gpscoordinates=42.5,42.5 "C:Photos\test\test2.mp4"

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

PeterC

iPhone recognizes coordinates when loaded as -keys:gpscoordinates=42.5,-42.5 .

Thanks again Phil.


PeterC

Hi Phil (or anyone with more experience than i).

With your help I happily put the locations etc into my older images.   I put my work on this down for a month and just started working on newer photos.

when I run the line below, the DateTimeOriginal is sucessfully updated.
C:\Users\Peter>"c:\Program Files (x86)\GeoSetter\tools\exiftool.exe" -DateTimeOriginal="2019:09:21 19:27:07" "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"
    1 image files updated

However, when I run the line below, the DateTimeOriginal is sucessfully updated but the coordinates are not added.
C:\Users\Peter>"c:\Program Files (x86)\GeoSetter\tools\exiftool.exe" -keys:gpscoordinates=31.4261139,-34.05948 -DateTimeOriginal="2019:09:21 19:27:07" "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"
    1 image files updated

When I run the line below the coordinates are not added.
C:\Users\Peter>"c:\Program Files (x86)\GeoSetter\tools\exiftool.exe" -keys:gpscoordinates="31.4261139,-34.05948" "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"
    0 image files updated
    1 image files unchanged

When I run the following lines, not tags are returned.   I am using 11.77 on Windows 10.
C:\Users\Peter>"c:\Program Files (x86)\GeoSetter\tools\exiftool.exe" "-gps*" -G1 "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"

Any ideas what is am doing wrong?

Thanks.

StarGeek

Keys:GPSCoordinates is a video tag, not an image tag.  There are four tags you need to use to set a GPS coordinate in an image, GPSLatitude/GPSLongitude/GPSLatitudeRef/GPSLongitudeRef.  Because the GPSLatitude/GPSLongitude tags are unsigned, they can't contain negative numbers, so there is a Ref (Directional Reference) tag to go with that.  They can be set to N/S/E/W or you can just use the same number that you set the actual coordinate with and exiftool will figure it out.
exiftool -GPSLatitude=31.4261139 -GPSLongitude=-34.05948 -GPSLatitudeRef=31.4261139 -GPSLongitudeRef=-34.05948 "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"
or
exiftool -GPSLatitude=31.4261139 -GPSLongitude=-34.05948 -GPSLatitudeRef=N -GPSLongitudeRef=W "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"

Edit: I just now realized, you could use a wildcard and set both at once.
exiftool -GPSLatitude*=31.4261139 -GPSLongitude*=-34.05948 "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"
* 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

Quote from: StarGeek on December 01, 2019, 07:14:31 PM
Edit: I just now realized, you could use a wildcard and set both at once.

Cool!  I hadn't thought of that.

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

PeterC

Hi StarGeek/Phil.   

Thanks so much for helping this newbie.   
So I know that for MOV and MP4, I can use     -keys:gpscoordinates=42.5,-42.5
And for JPG, JPEG, HEIC, I can used               -GPSLatitude*=42.5 -GPSLongitude*=-42.5

However,  the later approach does not seems quite complete for PNG files.   The data goes into the metadata fine as
[GPS]           GPS Version ID                  : 2.3.0.0
[GPS]           GPS Latitude Ref                : North
[GPS]           GPS Longitude Ref               : West
[Composite]     GPS Latitude                    : 42 deg 30' 0.00" N
[Composite]     GPS Longitude                   : 42 deg 30' 0.00" W
[Composite]     GPS Position                    : 42 deg 30' 0.00" N, 42 deg 30' 0.00" W
However, for the PNG file, the location does not show up when I view the File Properties in Windows, nor in the Windows Photo application, nor when I load the file onto my iPhone.   Do I need to also populate other fields to get them to appear in Windows 10 or iPhone?

Thanks in advance.

Phil Harvey

Support for metadata in PNG images is seriously lacking in most software other than ExifTool.

- 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: PeterC on December 02, 2019, 08:25:40 AM
However, for the PNG file, the location does not show up when I view the File Properties in Windows, nor in the Windows Photo application, nor when I load the file onto my iPhone.   Do I need to also populate other fields to get them to appear in Windows 10 or iPhone?

I can't speak to the iPhone except to echo what Phil said.  I've tested over 1,400 tags in PNG files on Windows and Windows will only read one tag, PNG:CreationTime, which it displays as "Date Taken".
* 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).

PeterC