ExifTool Forum

ExifTool => Newbies => Topic started by: kingvhit on October 08, 2020, 02:06:42 PM

Title: GeoTag with tracklog .gpx file
Post by: kingvhit on October 08, 2020, 02:06:42 PM
Hi,

I have an issue when working with .gpx file.
I tried to download the .gpx sameple file from here
https://github.com/gps-touring/sample-gpx/blob/master/BrittanyJura/Alt_Portsmouth.gpx

Then,  due to run this command, the warning message is throw

exiftool -geotag test.gpx -v4 119220730_3520999641267871_7694748503124752552_n.png
Argument "-Geotime<DateTimeOriginal#" is assumed
Loaded 0 points from XML-format GPS track log file 'test.gpx'
No track points found in GPS file 'test.gpx' in File:Geotag (ValueConvInv)
Warning: No track points found in GPS file 'test.gpx' in File:Geotag (ValueConvInv)
======== 119220730_3520999641267871_7694748503124752552_n.png
Setting new values from 119220730_3520999641267871_7694748503124752552_n.png
Warning: No writable tags set from 119220730_3520999641267871_7694748503124752552_n.png
Nothing changed in 119220730_3520999641267871_7694748503124752552_n.png
    0 image files updated
    1 image files unchanged


I think that the time data is missing on png file, also that's not exist on .gpx file. But, I would like to get all the location (lat, lon) from tracklog file without time stamp.

Is this possible to do like bellow

exiftool -geotag Cesena_ITALIA_2020-09-16T15_44_46.gpx -v4 119220730_3520999641267871_7694748503124752552_n.png
Argument "-Geotime<DateTimeOriginal#" is assumed
Loaded 31 points from XML-format GPS track log file 'Cesena_ITALIA_2020-09-16T15_44_46.gpx'
  GPS track start: 2020:09:16 10:06:34.000 UTC
    2020:09:16 10:06:34.000 UTC - alt=78.0 first=1 lat=44.135387 lon=12.237428
    2020:09:16 10:55:09.000 UTC - alt=83.0 lat=44.138107 lon=12.243875
    2020:09:16 11:35:59.000 UTC - alt=66.0 lat=44.135218 lon=12.234691
    2020:09:16 11:38:03.000 UTC - alt=74.0 lat=44.134709 lon=12.234613
    2020:09:16 11:38:33.000 UTC - alt=76.0 lat=44.133837 lon=12.235143
    2020:09:16 11:39:03.000 UTC - alt=76.0 lat=44.134425 lon=12.237386
    2020:09:16 11:39:33.000 UTC - alt=85.0 lat=44.134735 lon=12.239307
    2020:09:16 11:40:03.000 UTC - alt=98.0 lat=44.133023 lon=12.240633
    2020:09:16 11:40:33.000 UTC - alt=90.0 lat=44.132226 lon=12.242584
    2020:09:16 11:41:03.000 UTC - alt=89.0 lat=44.134524 lon=12.242429
    2020:09:16 11:41:33.000 UTC - alt=87.0 lat=44.134859 lon=12.245346
    2020:09:16 11:42:03.000 UTC - alt=89.0 lat=44.134947 lon=12.2469
    2020:09:16 11:42:33.000 UTC - alt=90.0 lat=44.134973 lon=12.247667
    2020:09:16 11:43:03.000 UTC - alt=86.0 lat=44.135164 lon=12.250649
    2020:09:16 11:43:33.000 UTC - alt=85.0 lat=44.136825 lon=12.253564
    2020:09:16 11:44:03.000 UTC - alt=87.0 lat=44.137629 lon=12.254535
    2020:09:16 11:44:33.000 UTC - alt=85.0 lat=44.137735 lon=12.256902
    2020:09:16 11:45:03.000 UTC - alt=78.0 lat=44.136355 lon=12.259862
    2020:09:16 11:45:33.000 UTC - alt=76.0 lat=44.13551 lon=12.260906
    2020:09:16 11:46:03.000 UTC - alt=76.0 lat=44.134963 lon=12.261313
    2020:09:16 11:46:33.000 UTC - alt=79.0 lat=44.134947 lon=12.26037
    2020:09:16 13:02:44.000 UTC - alt=86.0 lat=44.132526 lon=12.259548
    2020:09:16 13:25:50.000 UTC - alt=79.0 lat=44.134534 lon=12.260664
    2020:09:16 13:35:20.000 UTC - alt=116.0 lat=44.135458 lon=12.260064
    2020:09:16 13:41:45.000 UTC - alt=67.0 lat=44.133213 lon=12.264476
    2020:09:16 13:42:16.000 UTC - alt=71.0 lat=44.132273 lon=12.266355
    2020:09:16 13:42:46.000 UTC - alt=73.0 lat=44.131694 lon=12.268159
    2020:09:16 13:43:16.000 UTC - alt=72.0 lat=44.132123 lon=12.269185
    2020:09:16 13:43:46.000 UTC - alt=69.0 lat=44.133094 lon=12.270664
    2020:09:16 13:44:16.000 UTC - alt=71.0 lat=44.132904 lon=12.269643
    2020:09:16 13:44:46.000 UTC - alt=72.0 lat=44.132168 lon=12.269413
  GPS track end:   2020:09:16 13:44:46.000 UTC
Writing File:Geotag
======== 119220730_3520999641267871_7694748503124752552_n.png
Setting new values from 119220730_3520999641267871_7694748503124752552_n.png
Warning: No writable tags set from 119220730_3520999641267871_7694748503124752552_n.png
Nothing changed in 119220730_3520999641267871_7694748503124752552_n.png
    0 image files updated
    1 image files unchanged


Because, sometime, end-user is wipe all of the metadata on their photo, that we can re-use the lat lon location to re-attach to that photo with new current time stamp.

Regards
Title: Re: GeoTag with tracklog .gpx file
Post by: Phil Harvey on October 08, 2020, 03:02:26 PM
You should be able to just copy the GPS coordinates from the GPX file to the PNG file like this:

exiftool -tagsfromfile GPXFILE "-gpslatitude<LATTAG" "-gpslongitude<LONTAG" "-gpslatituderef<LATTAG" "-gpslongituderef<LONTAG" FILE

This works because ExifTool has basic support for reading XML-format files.  But you will have to figure out what tag names to use for LATTAG and LONTAG, with this command:

exiftool -s GPXFILE

However this will copy only one lat/lon position.  You say you want to copy them all, but I don't see how this would work.

- Phil
Title: Re: GeoTag with tracklog .gpx file
Post by: kingvhit on October 08, 2020, 10:27:51 PM
Thank for your info, I will re-check again !