Hello Phil,
I'm thrilled with the geolocation capabilities of ExifTool 12.79!
For testing the user-defined locations, I copied the UserDefined::Geolocation block from the example.config file from the 12.79 distribution to my .ExifTool_config and added a new location:
@Image::ExifTool::UserDefined::Geolocation = (
# (city,region,country code,country,timezone,population,lat,lon)
['Sinemorets','Burgas','BG','Bulgaria','Europe/Sofia',400,42.06115,27.97833],
['Satexco','Antioquia','CO','Colombia','America/Bogota',250,6.17087,-75.61440],
);
When running ExifTool with the -api geolocation option, I'm getting the following message:
Country code 'Bulgaria' in UserDefined::Geolocation is not 2 characters
Country code 'Colombia' in UserDefined::Geolocation is not 2 characters
If I change the countries names to their codes, BG for Bulgaria and CO for Colombia, I get this message:
Too few arguments in Sinemorets definition
Too few arguments in Satexco definition
Because of this issue, the user-defined location is not used by ExifTool.
I'm running ExifTool 12.79 with Geolocation500/Geolocation.dat v1.01 on macOS 12.6.3.
Thanks,
Christian W.
Hi Christian,
Sorry. The format for the user-defined entries changed in 12.79. The current geolocation.html web page should be correct.
Note that this is likely to change again for 12.80 since I think I'll be adding the feature code. (Apologies in advance.)
- Phil
Hello Phil.
Thanks for your answer. I copied the @Image::ExifTool::UserDefined::Geolocation block from the ExifTool Geolocation Feature page to my .ExifTool_config file and got the following error message:
Loaded .Exiftool_config!
Cannot pack NaN with 'n' at /usr/local/bin/lib/Image/ExifTool/Geolocation.pm line 248.
Compilation failed in require at /usr/local/bin/lib/Image/ExifTool.pm line 4324.
If I remove that block from the config file, ExifTool runs without issues.
Christian W.
Hi Christian,
The issue was simply that the config file Geolocation definitions didn't match the current format. I'm sort of surprised that someone was using these already, which is why I didn't take much care to make this backward compatible. I've gone and changed this format again in 12.80 (just released), but I think the format should be stable now.
- Phil
Hello Phil,
ExifTool v12.80 with Geolocation500 v1.02 works great with user defined cities:
ExifToolVersion : 12.80
GeolocationCity : Satexco
GeolocationRegion : Itagui
GeolocationSubregion : Antioquia
GeolocationCountryCode : CO
GeolocationCountry : Colombia
GeolocationTimeZone : America/Bogota
GeolocationFeatureCode : PPL
GeolocationPopulation : 250
GeolocationPosition : 6.1709, -75.6144
GeolocationDistance : 0.31 km
GeolocationBearing : 284
Thanks!
Christian W.
Hi Christian,
Excellent! Thanks for the feedback.
- Phil