ExifTool Forum

General => Metadata => Topic started by: b193709 on April 26, 2022, 06:44:07 PM

Title: GPS CSV takes more than 2 mins on load
Post by: b193709 on April 26, 2022, 06:44:07 PM
Hi all:

It's not a problem, since all works perfectly, but my CSV file with all GPS information takes more than 2 mins on load each time I run exiftool for updating photos. This CSV has info from 4+ years of continue location. I was thinking on change the approach, dividing the file on let's say 2 months data.. and calculate the file I need to take based on the info of the photo, but always I'll find some photos that are just on the edge of the file and probably I'll miss some.

I don't know if CSV is not very efficient for storing GPS info. I can convert it into other formats if it helps.

Thanks for any suggestion about.

Title: Re: GPS CSV takes more than 2 mins on load
Post by: Phil Harvey on April 27, 2022, 06:11:09 AM
How large is this CSV file?  And what O/S are you running on?

- Phil
Title: Re: GPS CSV takes more than 2 mins on load
Post by: b193709 on April 27, 2022, 08:49:52 AM
OSx.. (Mac).

162 Mb

Thanks
Title: Re: GPS CSV takes more than 2 mins on load
Post by: b193709 on April 27, 2022, 12:33:03 PM
Let me explain myself better :-).

I have many files that are on different timezone (GMT +0, GMT +1... etc). I need to add GPS info into them.

So.. my process is:

1) Extract the timezone of the photo and store it on the appropriated folder. I.E > if photos where taken on UTC 0, they are stored on /+0000 folder

Up to here it's ok.

2) I'm adding GPS info to them based on the folder they are:

exiftool  -geotag /Volumes/RAM\ Disk/GPX.GPX  '-geotime<${DateTimeOriginal}+00:00' /Volumes/RAM\ Disk/+0000/* -api GeoMaxIntSecs=300

Now .. supposing that I have 4 or more folders (I.E +0000, +0100, +0200, -0100).. I need to repeat 4 times the same process (2-4 minutes x each folder).

I tried to do conversion on 2 folders at the same time:

exiftool  -geotag /Volumes/RAM\ Disk/GPX.GPX  '-geotime<${DateTimeOriginal}+00:00' /Volumes/RAM\ Disk/+0000/*    '-geotime<${DateTimeOriginal}+01:00' /Volumes/RAM\ Disk/+0100/*       -api GeoMaxIntSecs=300


.... and works..

I think the best way of play this is create an array with all the geotime commends and its corresponding folder..

Any better way to approach this?

Thanks
Title: Re: GPS CSV takes more than 2 mins on load
Post by: Phil Harvey on April 27, 2022, 10:08:07 PM
That's a large CSV file.  You're lucky you're on MacOS -- you would run out of memory if you were in Windows.  I don't think there is any way to speed up reading such a large file.

Your combined command won't do what you want.  The last valid -geotime option will override earlier ones.

Your best bet to combine this into one command is to do something like this:

exiftool -geotag /Volumes/RAM\ Disk/GPX.GPX '-geotime<${DateTimeOriginal}${directory;$_ = m/\/([-+]\d{2})(\d{2})$/ ? "$1:$2" : undef}' /Volumes/RAM\ Disk/* -r -api GeoMaxIntSecs=300

Here I've taken the time zone from the directory name.

- Phil
Title: Re: GPS CSV takes more than 2 mins on load
Post by: b193709 on April 28, 2022, 06:23:32 AM
wow.. thanks!

If I understood well this command, basically it will take from the name of the directory (I.E +00:00) this timezone for applying to any file recursive from /Volumes/RAM\ Disk/*

It solves all my problems at once.. since it will goes recursive on all directories automatically, will apply the correct timezone based on the directory !! Awesome!.. Thanks

I have just only one question, I promise. In case my file doesn't have  DateTimeOriginal tag, but has another with same information (Creation time, IE), is there any way of using the 2 options on this command in order to avoid run the command twice?

Thanks
Title: Re: GPS CSV takes more than 2 mins on load
Post by: StarGeek on April 28, 2022, 10:35:00 AM
Quote from: b193709 on April 28, 2022, 06:23:32 AMIn case my file doesn't have  DateTimeOriginal tag, but has another with same information (Creation time, IE), is there any way of using the 2 options on this command in order to avoid run the command twice?

See Note #1 under the -TAG[+-^]=[VALUE] option (https://exiftool.org/exiftool_pod.html#TAG---VALUE)
     Many tag values may be assigned in a single command. If two assignments affect the same tag, the latter takes precedence

For example, this will use DateTimeOriginal if it exists, otherwise it will fall back upon CreateDate.
'-geotime<${CreateDate}${directory;$_ = m/\/([-+]\d{2})(\d{2})$/ ? "$1:$2" : undef}' '-geotime<${DateTimeOriginal}${directory;$_ = m/\/([-+]\d{2})(\d{2})$/ ? "$1:$2" : undef}'
Title: Re: GPS CSV takes more than 2 mins on load
Post by: b193709 on April 28, 2022, 02:24:57 PM
This is perfect. Works like a charm. Thanks a lot.

I'm having many ""No writable tags set from ......................". I guess this is because there is no GPX info aplicable to the picture.. isn't it?
Title: Re: GPS CSV takes more than 2 mins on load
Post by: Phil Harvey on April 28, 2022, 02:28:10 PM
Quote from: b193709 on April 28, 2022, 02:24:57 PM
I'm having many ""No writable tags set from ......................".

Either there is no appropriate date/time tag for any of the -geotime commands, or the time is too far from the nearest GPS fix.  The warnings will tell you which is the case.

- Phil
Title: Re: GPS CSV takes more than 2 mins on load
Post by: b193709 on April 28, 2022, 02:48:14 PM
I'm so ashamed because of asking a lot and probably stupid questions...

On my warnings don't say anything else than " No writable tags set from.... (name of the file)"...

Also.. I'm trying to play this command silent. I saw on the doc that with -q -q -m I can supress all errors and warnings.

Thanks
Title: Re: GPS CSV takes more than 2 mins on load
Post by: Phil Harvey on April 29, 2022, 09:20:12 PM
Add -a to see all the warnings, but -q -q will of course suppress these.

- Phil