Cannot write geotags to images using .gpx and .kml

Started by Juggernaut, June 16, 2018, 11:43:44 AM

Previous topic - Next topic

Juggernaut

I'm trying to write geotags with KML file:

exiftool img.png -geotag log.kml

and getting this:

QuoteWarning: No track points found in GPS file 'log.kml' in File:Geotag (ValueConvInv)
Warning: No writable tags set from img.png
    0 image files updated
    1 image files unchanged

The same with .png image and .jpg image.

When I try to write geotags with GPX file:

exiftool img.png -geotag log.gpx

I'm getting this:
QuoteWarning: No writable tags set from img.png
    0 image files updated
    1 image files unchanged


What should I do to fix it?

I've recorded GPX and KML files using popular Android app, that provides records to GPS logs.

I've already created a topic earlier with the questions for this case.... about what are the mandatory tags for GPX and KML files? But I didn't get the clear answer.

Juggernaut

Does anyone has a template of .GPX or .KML file?

I need exactly a file with all the tags, that ExifTool calls for.

I don't know how it should look like, so I cannot use ExifTool because of these errors.

Maybe these errors appear because of wrong syntax, that Android software write. I don't know. Maybe Android GPS logger app writes too many tags, or less than ExifTool needs. I have no idea at all, because I don't have a simple template with all mandatory tags.

StarGeek

Maybe check the time stamp on the image?  Your command doesn't have a geotime set and PNGs don't normally have a DateTimeOriginal set.

I was able to geotag with your log.gpx once I set the DateTimeOriginal of a test image correctly, accounting for timezone.

edit:  While I'm not familiar with how the format works, looking at log.kml, there's no timestamps in the file like there is with the gpx file and I was unable to geotag with it.

Don't forget you can run exiftool on the gpx and kml files to see some of the info in the file.
* 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).

Juggernaut

Quote from: StarGeek on June 16, 2018, 12:20:59 PM
Maybe check the time stamp on the image?  Your command doesn't have a geotime set and PNGs don't normally have a DateTimeOriginal set.

I was able to geotag with your log.gpx once I set the DateTimeOriginal of a test image correctly, accounting for timezone.

edit:  While I'm not familiar with how the format works, looking at log.kml, there's no timestamps in the file like there is with the gpx file and I was unable to geotag with it.

Don't forget you can run exiftool on the gpx and kml files to see some of the info in the file.

I don't know how to set DateTimeOriginal for the image.
I don't know what the DateTimeOriginal is.
I don't know where to look for DateTimeOriginal. In GPX file? There is no keys, like DateTimeOriginal

PS: it would be great if you could write concrete commands, that you write. Or concrete actions you do.

Phil Harvey

I think that your troubles are explained by troubleshooting tips number 1 and 2 here.

- 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: Juggernaut on June 17, 2018, 11:26:28 AM

I don't know how to set DateTimeOriginal for the image.
I don't know what the DateTimeOriginal is.
I don't know where to look for DateTimeOriginal. In GPX file? There is no keys, like DateTimeOriginal

PS: it would be great if you could write concrete commands, that you write. Or concrete actions you do.

The command I used was the one you used in your first post, except with my test file
exiftool y:\!temp\Test3.jpg -geotag log.gpx
(As I metioned, the KML file doesn't contain any timing info and can't be used to geotag without some extra effort.)

The problem is that there is no way for exiftool to geotag a file with the data from a GPS file if there isn't a time stamp to figure out when the photo is taken.

There are a couple ways to let exiftool know the when.  There's the special tag (Geotime) that can be set on the command line to set a specific time.  Otherwise, if Geotime isn't set on the command line, exiftool will read the image file looking for the DateTimeOriginal tag.  DateTimeOriginal is a tag which holds the time stamp of when the picture was taken and is set automatically by almost all cameras.  Exiftool would then use that time stamp to figure out the "where" in the GPS log at that time and geotag that location.

In your example, you use a png file, which wouldn't be a file from a camera, at least, not directly, and wouldn't have a DateTimeOriginal tag.  To set it, the command is simple:
exiftool -DateTimeOriginal="YYYY:MM:DD HH:mm:SS" image.png

One more thing to take note of is related to time zones.  The time stamps in gps files are based upon UTC.  Exiftool will assume the time zone is the current time zone of the system the processing takes place on.  So if you are, for example,  on vacation on the East coast of the US right now (TZ -4) and take a geo track at noon (12:00), the time stamp in the GPS file will be at 16:00.  Then if you go to your home on the West coast (TZ -7) and try to geotag on your computer there, exiftool won't be able to geotag the file because it will assume that the file is noon west coast and look for a time stamp in the gps file of UTC 19:00.  This can be corrected with the Geosync option on the command line.

Make sure to read the Geotagging with ExifTool page for more info and examples.

One more thing to take note of is that fact that metadata in PNG files has very little support.  Geotagging one will probably not show the location if you, for example, upload it to Google photos. 
* 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).