User-defined Geolocation example.config still in the old format

Started by wywh, April 22, 2024, 06:13:06 AM

Previous topic - Next topic

wywh

It seems https://exiftool.org/config.html and Download Version 12.83 and https://github.com/exiftool/exiftool/blob/master/config_files/example.config have the User-defined Geolocation example.config in the old format:

    # (city,region,country code,country,timezone,population,lat,lon)
    ['Sinemorets','Burgas','BG','Bulgaria','Europe/Sofia',400,42.06115,27.97833],

Which produces an error and a few lost hair:

exiftool -config example.config -a -api Geolocation='Sinemorets'
Too few arguments in Sinemorets definition (check for updated format)
Warning: No such city in Geolocation database -

That example entry should obviously be:

    # (city,region,subregion,country_code,country,timezone,feature_code,population,lat,lon)
    ['Sinemorets','Burgas','Obshtina Tsarevo','BG','Bulgaria','Europe/Sofia','PPL',400,42.06115,27.97833],

Then it works as expected:

exiftool -config example.config -a -api Geolocation='Sinemorets'
Geolocation City                : Sinemorets
Geolocation Region              : Burgas
Geolocation Subregion           : Obshtina Tsarevo
Geolocation Country Code        : BG
Geolocation Country             : Bulgaria
Geolocation Time Zone           : Europe/Sofia
Geolocation Feature Code        : PPL
Geolocation Population          : 400
Geolocation Position            : 42.0612, 27.9784

After I got that working, I experimented by adding:

    ['City','Region','Subregion','IN','India','Asia/Kolkata','PPL',6,14.79354,75.40448],
But exiftool was not happy about that:

exiftool -config example.config -a -api Geolocation='City'
AddEntry: Too many subregions
Warning: No such city in Geolocation database -

Removing Subregion entry fixed that. Why?

    ['City','Region','','IN','India','Asia/Kolkata','PPL',6,14.79354,75.40448],

exiftool -config example.config -a -api Geolocation='City'
Geolocation City                : City
Geolocation Region              : Region
Geolocation Country Code        : IN
Geolocation Country             : India
Geolocation Time Zone           : Asia/Kolkata
Geolocation Feature Code        : PPL
Geolocation Population          : 6
Geolocation Position            : 14.7936, 75.4043

Or using some other random Subregion surprisingly works:

    ['City','Region','Obshtina Tsarevo','IN','India','Asia/Kolkata','PPL',6,14.79354,75.40448],

exiftool -config example.config -a -api Geolocation='City'
Geolocation City                : City
Geolocation Region              : Region
Geolocation Subregion           : Obshtina Tsarevo
Geolocation Country Code        : IN
Geolocation Country             : India
Geolocation Time Zone           : Asia/Kolkata
Geolocation Feature Code        : PPL
Geolocation Population          : 6
Geolocation Position            : 14.7936, 75.4043

- Matti

Phil Harvey

Hi Matti,

Thank you for taking the time to report this.

This will be fixed in 12.84.

But note that in the current version of the database these coordinates round off to the same location as Hāveri, so it will be by chance if you get one or the other.

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

Phil Harvey

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

wywh

Thanks, now user-defined Geolocation works perfectly. (minor nitpick: Region Burgas is not capitalized in the example.config but exiftool auto-capitalizes and corrects such words unless there are extra spaces  :))

Phil Harvey

Great.

Yes, case is not significant when I test to see if a region/subregion/country/timezone already exists in the database.  And if so that name is used instead.  I did Burgas like this purposely to test this out.

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