KML or GPX sync with pictures MacOS

Started by zierbeek, April 26, 2021, 04:00:27 AM

Previous topic - Next topic

zierbeek

Hi all,

I have imported all my pictures using photoprism. Now they are all sorted in folders with Year-Month

From my trip in France, I have the kml from google timeline, day by day.
Would it be possible to sync a kml from each day with the pictures made on that day?
Or would it be better to merge all the kml's into 1?

Thanks in advance!
Matthias

StarGeek

From the docs on the Geotag option
QuoteMultiple GPS log files may be loaded simultaneously by using more than one -geotag option or -geotag= assignment in the same command. This allows batch processing of images spanning different tracks with a single command

So you could just put all the geotracks in the command.
"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

Phil Harvey

I've edited the documentation to also mention the wildcard feature in this sentence:

Multiple GPS log files may be loaded simultaneously by using more than one -geotag option or -geotag= assignment in the same command, or by using wildcards in the filename argument of the -geotag option.

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

zierbeek

I tried these line, without success. something I'm missing?

exiftool -geotag=history-2020-09-11.kml smb://192.168.0.16/tank1/Photos/2020/09
exiftool -geotag=history-2020-09-11.kml //192.168.0.16/tank1/Photos/2020/09
exiftool -geotag=history-2020-09-11.kml 192.168.0.16/tank1/Photos/2020/09

StarGeek

You will probably need to copy the files over to a local directory.  I don't believe that exiftool can connect across smb.
"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

zierbeek

nah that isn't an option since it's 800 gib.

Phil Harvey

I'm no expert, but can't you mount the smb drive like you would an nfs drive?

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

zierbeek

Hi all,

Back from my next trip and giving this another go.

I Used this command to geotag: exiftool -geotag=20210723053148-04063-data.gpx /Users/matthias/Desktop/Italië\ 2021\ Import

I have followed the page of the geotagging but can't figure this command out. I tried to sync but got the 'No writable tags' error. Then used the command to check the tags.
I have all of these. I see there is a DateTimeOriginal so I should be fine?
FileModifyDate                  : 2021:07:16 16:25:56+02:00
FileAccessDate                  : 2021:07:20 22:07:28+02:00
FileInodeChangeDate             : 2021:07:20 22:07:27+02:00
ModifyDate                      : 2021:07:16 16:25:56
DateTimeOriginal                : 2021:07:16 16:25:56
CreateDate                      : 2021:07:16 16:25:56

StarGeek

Is the time zone where you shot the pictures the same as the time zone of the computer you're running on?  If not, you need to either use -GeoSync to adjust the difference between the time zones or use -GeoTime to explicitly set the time.

For example, if I have an image taken in East Coast US (TZ -05:00) taken at 2013:01:28 18:47:15, the geotrack will show 2013:01:28 23:47:15Z.  I then return home to West Coast US (TZ-08:00).  I try to geotag directly I get this
C:\>exiftool -P -overwrite_original -geotag=Y:\Data\dump\Text\Geotracks\2013-01-28_152504.gpx y:\!temp\Test4.jpg
Warning: Time is too far beyond track in File:Geotime (ValueConvInv) - y:/!temp/Test4.jpg
Warning: No writable tags set from y:/!temp/Test4.jpg
    0 image files updated
    1 image files unchanged


That is because my local time zone is now -08:00 and exiftool will assume the local time zone of the computer.  So I have to shift this in one of two ways.  I can either explicitly add the time zone with GeoTime
C:\>exiftool -P -overwrite_original "-GeoTime<${DateTimeOriginal}-05:00" -geotag=Y:\Data\dump\Text\Geotracks\2013-01-28_152504.gpx  y:\!temp\Test4.jpg
    1 image files updated


Or I can use GeoSync to adjust the difference by taking the time zone of the the computer (-08:00) and subtracting the time zone of the location (-05:00) which gives -08:00-(-05:00) = -03:00
C:\>exiftool -P -overwrite_original -GeoSync=-3:0:0 -geotag=Y:\Data\dump\Text\Geotracks\2013-01-28_152504.gpx  y:\!temp\Test4.jpg
    1 image files updated


In your case, I'm guessing you can either use
exiftool -geotag=20210723053148-04063-data.gpx '-Geotime<${DateTimeOriginal}+02:00' /Users/matthias/Desktop/Italië\ 2021\ Import
or this (I don't know your time zone so I'm not sure if it will be -1:0:0 or -2:0:0)
exiftool -geotag=20210723053148-04063-data.gpx '-Geosync=-1:0:0"  /Users/matthias/Desktop/Italië\ 2021\ Import
"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

zierbeek

Quote from: StarGeek on July 23, 2021, 01:12:15 PM
Is the time zone where you shot the pictures the same as the time zone of the computer you're running on?  If not, you need to either use -GeoSync to adjust the difference between the time zones or use -GeoTime to explicitly set the time.

For example, if I have an image taken in East Coast US (TZ -05:00) taken at 2013:01:28 18:47:15, the geotrack will show 2013:01:28 23:47:15Z.  I then return home to West Coast US (TZ-08:00).  I try to geotag directly I get this
C:\>exiftool -P -overwrite_original -geotag=Y:\Data\dump\Text\Geotracks\2013-01-28_152504.gpx y:\!temp\Test4.jpg
Warning: Time is too far beyond track in File:Geotime (ValueConvInv) - y:/!temp/Test4.jpg
Warning: No writable tags set from y:/!temp/Test4.jpg
    0 image files updated
    1 image files unchanged


That is because my local time zone is now -08:00 and exiftool will assume the local time zone of the computer.  So I have to shift this in one of two ways.  I can either explicitly add the time zone with GeoTime
C:\>exiftool -P -overwrite_original "-GeoTime<${DateTimeOriginal}-05:00" -geotag=Y:\Data\dump\Text\Geotracks\2013-01-28_152504.gpx  y:\!temp\Test4.jpg
    1 image files updated


Or I can use GeoSync to adjust the difference by taking the time zone of the the computer (-08:00) and subtracting the time zone of the location (-05:00) which gives -08:00-(-05:00) = -03:00
C:\>exiftool -P -overwrite_original -GeoSync=-3:0:0 -geotag=Y:\Data\dump\Text\Geotracks\2013-01-28_152504.gpx  y:\!temp\Test4.jpg
    1 image files updated


In your case, I'm guessing you can either use
exiftool -geotag=20210723053148-04063-data.gpx '-Geotime<${DateTimeOriginal}+02:00' /Users/matthias/Desktop/Italië\ 2021\ Import
or this (I don't know your time zone so I'm not sure if it will be -1:0:0 or -2:0:0)
exiftool -geotag=20210723053148-04063-data.gpx '-Geosync=-1:0:0"  /Users/matthias/Desktop/Italië\ 2021\ Import

Hi, Thanks for your answer.
I would not know if I would need to use geosync or geotime since I am in the same timezone as the camera, and the trip we did. My timezone is gmt +2 , central Europe :)

StarGeek

Quote from: zierbeek on July 23, 2021, 03:54:56 PM
I would not know if I would need to use geosync or geotime since I am in the same timezone as the camera, and the trip we did. My timezone is gmt +2 , central Europe :)

If that's the case then you'll have to look at the GPX files to look at the <time> entries.  The GPX time entries should be two hours before the time listed in the file.  So in your example, the image is showing a DateTimeOriginal of "2021:07:16 16:25:56" and you would need to verify there's a time entry that would be around "2021:07:16 14:25:56".
"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

zierbeek

Quote from: StarGeek on July 23, 2021, 04:23:05 PM
Quote from: zierbeek on July 23, 2021, 03:54:56 PM
I would not know if I would need to use geosync or geotime since I am in the same timezone as the camera, and the trip we did. My timezone is gmt +2 , central Europe :)

If that's the case then you'll have to look at the GPX files to look at the <time> entries.  The GPX time entries should be two hours before the time listed in the file.  So in your example, the image is showing a DateTimeOriginal of "2021:07:16 16:25:56" and you would need to verify there's a time entry that would be around "2021:07:16 14:25:56".

Got it working man, just used the standard kml output from google timeline, not the converted to gpx file! :) Now a way to merge all of the kml's into 1

zierbeek

#12
No succes with merged kml file, so going through all of them one by one
changing each day and so checking all pictures and only changing the ones on that day. Is there a faster way? No worries if there isn't ;)
exiftool -geotag=history-2021-07-04.kml /Users/matthias/Desktop/Italië\ 2021\ Import



Also, some of the pictures do have a geolocation, others not. Due to interpolation i guess?


About the geosync, Time stap of created image and gps are indeed 2h apart. Do i need to do the +2 in that case?


StarGeek

Quote from: zierbeek on July 23, 2021, 04:24:58 PMNow a way to merge all of the kml's into 1

Don't bother.  From the Geotag docs
    Multiple GPS log files may be loaded simultaneously by using more than one -geotag option or -geotag= assignment in the same command, or by using wildcards in the filename argument of the -geotag option. This allows batch processing of images spanning different tracks with a single command. When using wildcards the argument may need to be quoted on some systems to prevent shell globbing, but note that wildcards are not supported with the -geotag= syntax.

"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

StarGeek

Quote from: zierbeek on July 23, 2021, 04:31:29 PM
About the geosync, Time stap of created image and gps are indeed 2h apart. Do i need to do the +2 in that case?

You shouldn't need it.  If you're in time zone +02:00 and the time in the trace is two hours before that, then that should work correctly.
"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