Country Codes used in the Reverse Geocoding and Edit Locations dialogs

Started by Tveloso, January 12, 2021, 02:05:13 PM

Previous topic - Next topic

Tveloso

This isn't really a legitimate feature request...it's really just a Change Request that's rather trivial, and maybe not even worth the time.  But nevertheless, the ScreenShot in this post:

Quote from: frlindla on January 10, 2021, 08:22:42 AM
Screenshot 1 shows the reverse geocoding after coordinates are applied...

...reminded me about the "issue" I occasionally have with Country Codes.

The vast majority of the photos in my IMatch Database were taken in the US, and a large majority of those, get their location data at ingest, by virtue of a few IMath Locations, where the available Counry Codes are the 3-Bytes Codes...(so these files will get a Country Code of "USA").

When we do a Reverse Geocode, the service returns the 2-Byte Country Codes.  But in this dialog too, it's actually the 3-byte codes that are available in the Dropdown (I imagine that both dialogs use the same data source for that dropdown):

       

...yet it's the 2-Byte code returned by the Service that's actually assigned to the file.

So it's Country Code "US" that my files get, when the location data comes from a Reverse Geocode operation, and "USA" when the location data comes from from an IMatch Location.

Could the Country Codes returned by those two dialogs be synchronized?...either by simply replacing the contents of the dropdown with the 2-Byte Codes, or by creating a configuration option to allow the user to select between the 2-Byte and 3-Byte codes?...

Again, it's not at all important to have this change - IMatch makes it very easy for us to update the Country Codes that are actually in our files, so it's easy to synchronize them afterwards.
--Tony

Jingo

I knew this sounded familiar - you asked a similar question back in 2019 to request a 2 digit code  8)

https://www.photools.com/community/index.php?topic=8879 - interestingly enough, Mario stated a 3 digit code is the XMP standard so something must have changed between versions to store the 2 digit code internally though the 3 digit code is showing in the dialog.

Mario

IMatch uses 3-letter codes. Geocoding services use whatever they like, no standard. By default the geo-coding uses what the service has delivered. You can change that in the drop-down if you like.
I could maybe add a 2->3 mapping (as an option) in this dialog if there is sufficient interest. Not sure. Let's see.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

bekesizl

+1 on the 2->3 mapping.

It would be good to have the same results from all services in the database.

Tveloso

Quote from: Jingo on January 12, 2021, 02:52:06 PM
I knew this sounded familiar - you asked a similar question back in 2019 to request a 2 digit code  8)

https://www.photools.com/community/index.php?topic=8879 - interestingly enough, Mario stated a 3 digit code is the XMP standard so something must have changed between versions to store the 2 digit code internally though the 3 digit code is showing in the dialog.

Wow, great memory!

I forgot that I had posted about that previously...(at the time, I was interested only in "converting" to the 2 character codes exclusively).  As with other (more significant) things in IMatch, as I have learned more about IMatch, and gained insights from the posts in this great community, I have changed the way I'm doing things...sometimes going back an forth between approaches.

I did that with the Country Codes...(going back an forth between all 2-character, and all 3-character codes), and have settled on using the 3 character codes.  So another +1 on the 2->3 mapping.

--Tony
--Tony

jch2103

Quote from: bekesizl on January 12, 2021, 04:13:47 PM
+1 on the 2->3 mapping.

It would be good to have the same results from all services in the database.

I agree. Would simplify things.
John

BanjoTom

Another +1 on 2 to 3 mapping.  Always seems good if things can be kept consistent...
Quote+1 on the 2->3 mapping.
— Tom, in Lexington, Kentucky, USA

nacho02

Ignacio

Mario

I've looked into this.

The interactive reverse geocoding dialog now automatically maps 2-letter country codes ("US") to their respective 3-letter code ("USA") using a A2/A3 country code table IMatch maintains as part of its resources, if the service does not deliver a 3-letter code. This is done before presenting the results in the dialog.

IMatch does this mapping already when you use the automatic reverse geocoding option available for the Map Panel.
In this automatic mode, IMatch takes the first/best match provided by the geocoding service provider but performs some additional checks and clean-up before writing the address record to the database. Part of this process is the mapping of the A2 ISO code to the A3 ISO code via an internal table if the service does not deliver an A3 code.

In interactive mode, IMatch did not perform this mapping or checks and used the data 'as-delivered' by the service, adding it to the A2 to the drop-down country code selector list in the dialog if needed.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook


Mario

Quote from: Tveloso on January 17, 2021, 01:04:29 PM
Thank you so much Mario!

Tip: If you have two-digit codes in your database and you want to consolidate, you can easily find them via a data-driven category based on this tag.
Select all files with US, change the value to USA in the Metadata Panel and the metadata is consistent again. Repeat with other country codes as needed.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

jch2103

Quote from: Mario on January 17, 2021, 02:02:40 PM
Quote from: Tveloso on January 17, 2021, 01:04:29 PM
Thank you so much Mario!

Tip: If you have two-digit codes in your database and you want to consolidate, you can easily find them via a data-driven category based on this tag.
Select all files with US, change the value to USA in the Metadata Panel and the metadata is consistent again. Repeat with other country codes as needed.

Thank you! I just had a few hundred 2-character country codes, for two countries, but this change will keep things cleaner in the future.

BYW, for anyone looking to use a data-driven category for this, the tag is XMP::iptcCore\CountryCode\CountryCode\0.
John