Would you be able to include "county" in Geolocation tags?

Started by mceachen, March 09, 2024, 06:16:06 PM

Previous topic - Next topic

mceachen

First off: holy moly Geolocation is amazing! Thanks for making that happen!

In larger states (like California), there are a bunch of duplicate-named cities (like Burbank and Seacliff). It'd be great to include the "admin2 code" GeoNames field as a "Geolocation County" to disambiguate (but I realize that requires pulling in a chunk of the 2MB https://download.geonames.org/export/dump/admin2Codes.txt file).

Here's a list of the duplicate city names in California:

cat ~/Downloads/US/US.txt | egrep '\sCA\s' | egrep '\sP\s' | cut -d$'\t' -f3 | sort | uniq -cd

Thanks!

stoffball

Quote from: mceachen on March 09, 2024, 06:16:06 PMIt'd be great to include the "admin2 code" GeoNames field as a "Geolocation County" to disambiguate

The admin2code identify a county only in USA, UK, Canada and some other countries.
In other country the admin2 code describes something other (because there are different hierarchy in different countries).
In the Netherlands it is the Gemeente or municipality. In Germany it is Regierungsbezirk or governmental district. see discussion at https://exiftool.org/forum/index.php?msg=84993

So this is not so easy to simple call the admin2code "County".

tkohhh

Just to make sure I understand, is the problem that sometimes the "admin2 code" is larger than the City, and sometimes it is smaller than the City?

Phil Harvey

I'll look into adding the admin2 codes and see how large that makes the database.

- 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

Cool.  Actually, I was able to include admin2 codes (I'm calling them subregions) and at the same time actually reduce the database size from 3.7 MB to 3.3 MB by some clever restructuring.

...now I just need to re-work the language translations for the new subregions.  (Yes, the next release should also include alternate language support for Geolocation tags, although the geonames.org language coverage isn't very comprehensive.)

- 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

Ooops.  I was looking at the wrong versions of the database.  I did apply some much better compression, but it was the old database that was 3.3 MB, not the new one.  So the database went from 3.3 to 3.7 MB, plus more for the additional language translations which are in separate files.  The ExifTool .tar.gz file will be in the neighbourhood of 8.2 MB now.  The last release was 7.0 MB, and the size was 5.3 MB before the Geolocation feature was added.  Oh well, I hope the usefulness of this new feature justifies the extra bandwidth usage and disk space.

- 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

I've finally settled on including a database with cities of population > 2000 in version 12.79.  This is a compromise to keep the distribution size down a bit.  But I'll provide a downloadable version of a 500-population database for those who want it.

I've been ignoring basically everything else as I've been working on this for the last week or so.  I plan to release this later today so I can get back to doing other things. :P

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

FrankB

Quote from: Phil Harvey on March 15, 2024, 12:59:10 PMI've been ignoring basically everything else as I've been working on this for the last week or so.

Really appreciate it Phil. Thanks.

Phil Harvey

Done.  Version 12.79 is now available. :) 

(now I can get on with my life...)  ;)

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

mceachen


Phil Harvey

I've just released 12.80 btw, with more improvements.

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