Author Topic: Logic behind Geotagging  (Read 9127 times)

BogdanH

  • ExifTool Freak
  • *****
  • Posts: 757
  • ExifToolGUI Author
Logic behind Geotagging
« on: June 08, 2011, 08:30:53 AM »
Hi,

I've just tried ExifTool geotagging by using NMEA log file and it works -no, I'm not surprised  :). Now, before I start to implement that in GUI and to avoid time consuming experiments, few questions (just to clarify in my head):

1. Because logging happens in time intervals, Exif DateTime values will always differ those from GPS log file. I assume, that (because of this) ExifTool is interpolating Latitude, Longitude and Altitude values from nearby (closest time match) values. That is, in most cases, these three values (and GPSTimeStamp) written inside Exif can't be actually found inside log file. Am I correct?

2. My logger allows logging Latitude/Longitude values only (thus, no Altitude). I haven't tried that option yet, but... if that value is missing in log file, will ExifTool create GPSAltitude tag anyway? If yes, what value will be in there?

3. Assuming my camera has correct local time and logger always uses UTC... As long I'm taking photos in my "local (time) area", there's no need to use -GeoTime option, because ExifTool will automatically know TimeZone difference by using PC's system time(zone). Am I correct?

4. I'm in Moscow and I take photo there at 10:00AM (their local time). Camera is set to their local time as well, thus DateTimeOriginal=10:00:00. Because logger uses UTC, log file will contain time=07:00:00 (Moscow's TimeZone=+3h). When comming home (TimeZone=+1h) I'm geotagging my photo... what -GeoTime value must I use:
+1 -because that's my local TimeZone?
+2 -because that's the difference between Moscow and my (home) TimeZone?
+3 -because that's Moscow's TimeZone?

Added:
Is it possible you would limit GPSAltitude precission to (say) max two decimal numbers? I assume, commercial gps units aren't not even that precise. Speaking for me, one decimal point would be more than enough...

Thanks for taking time to answer.
Bogdan
« Last Edit: June 08, 2011, 08:39:43 AM by BogdanH »

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 10744
    • ExifTool Home Page
Re: Logic behind Geotagging
« Reply #1 on: June 08, 2011, 08:39:32 AM »
ExifTool is interpolating Latitude, Longitude and Altitude values from nearby (closest time match) values.

Correct.  A linear interpolation between the nearest GPS fixes before and after the image time.

Quote
2. My logger allows logging Latitude/Longitude values only (thus, no Altitude). I haven't tried that option yet, but... if that value is missing in log file, will ExifTool create GPSAltitude tag anyway?

No.  In this case ExifTool will write GPS tags without altitude.

Quote
3. Assuming my camera has correct local time and logger always uses UTC... As long I'm taking photos in my "local (time) area", there's no need to use -GeoTime option, because ExifTool will automatically know TimeZone difference by using PC's system time(zone). Am I correct?

Yes.

Quote
4. I'm in Moscow and I take photo there at 10:00AM (their local time). Camera is set to their local time as well, thus DateTimeOriginal=10:00:00. Because logger uses UTC, log file will contain time=07:00:00 (Moscow's TimeZone=+3h). When comming home (TimeZone=+1h) I'm geotagging my photo... what -GeoTime value must I use:
+1 -because that's my local TimeZone?
+2 -because that's the difference between Moscow and my (home) TimeZone?
+3 -because that's Moscow's TimeZone?

You must specify the timezone for the date/time stored in the image.  In this case: "-Geotime<${DateTimeOriginal}+03:00"

- Phil
...where DIR is the name of a directory containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BogdanH

  • ExifTool Freak
  • *****
  • Posts: 757
  • ExifToolGUI Author
Re: Logic behind Geotagging
« Reply #2 on: June 08, 2011, 08:42:20 AM »
That was fast... thanks.
Did you noticed my "Added" comment about Altitude precission?

Bogdan

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 10744
    • ExifTool Home Page
Re: Logic behind Geotagging
« Reply #3 on: June 08, 2011, 08:46:04 AM »
Hi Bogdan,

The Composite:GPSAltitude tag limits the precision to 1 decimal point if this helps.

- Phil
...where DIR is the name of a directory containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BogdanH

  • ExifTool Freak
  • *****
  • Posts: 757
  • ExifToolGUI Author
Re: Logic behind Geotagging
« Reply #4 on: June 08, 2011, 12:01:27 PM »
Hi Phil,

Now I am a bit counfused... On my 3rd question you said, that no TimeZone offset (-GeoTime option) is needed to be applied, because PC's system time is the same as set in camera (where PC's system time is set to my TimeZone, which is +1h). To elaborate: i.e. photo DateTime is 10:00h (camera setting for my local time) and log data is 09:00 (because UTC is written) -in such scenario ExifTool will find correct GPS data inside log file and write it into imagefile.
If that's true, then for my 4th question, I don't understand why +3h is needed to be used (I would expect +2h)... Does ExifTool in this case (because -GeoTime is specified) discards PC's system TimeZone ant takes only -GeoTime value into account?

This TimeZone stuff is allready confusing and then my poor grammar... I hope you understand what I'm trying to say. The thing is, in GUI, settings needed to be done, should be easy to understand (so user has no doubts about what he's doing).

Bogdan

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 10744
    • ExifTool Home Page
Re: Logic behind Geotagging
« Reply #5 on: June 08, 2011, 12:31:38 PM »
Hi Bogdan,

Because you are specifying the time zone of the camera, not a time offset from the system time.  The time zone of the camera was +03:00.  If you specify the camera time zone then the system time is irrelevant.  The system time zone is only used if the image time doesn't have a timezone.

- Phil
...where DIR is the name of a directory containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BogdanH

  • ExifTool Freak
  • *****
  • Posts: 757
  • ExifToolGUI Author
Re: Logic behind Geotagging
« Reply #6 on: June 08, 2011, 04:51:59 PM »
Hi Phil,

I've succeed to implement geotagging in GUI. Among other things, I also checked what happens if some totally wrong file is picked instead of valid log file. Of course, ExifTool doesn't modify target image files in this case. What user gets in this case, is list of warnings and list of files where "Nothing changed", which can be quite long if many images are selected. How about simple/short "Not valid log file -Nothing changed" message in such case? Just an idea.
And final question: are there cameras, where one can set TimeZone offset and this value is then written by camera in Exif:TimeZoneOffset?

Bogdan

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 10744
    • ExifTool Home Page
Re: Logic behind Geotagging
« Reply #7 on: June 08, 2011, 05:07:24 PM »
Hi Bogdan,

I've succeed to implement geotagging in GUI.

Excellent!

Quote
What user gets in this case, is list of warnings and list of files where "Nothing changed", which can be quite long if many images are selected. How about simple/short "Not valid log file -Nothing changed" message in such case? Just an idea.

I think you're stuck with this behaviour because adding the code to check for this special case wouldn't be pretty, but I'll look into it in more detail.

Quote
And final question: are there cameras, where one can set TimeZone offset and this value is then written by camera in Exif:TimeZoneOffset?

I haven't seen any.  Unfortunately this isn't standard EXIF.

- Phil
...where DIR is the name of a directory containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).