How To Clear Entries from the Country, State/Province, City & Location Fields

Started by moviemaker445, August 25, 2023, 09:00:25 AM

Previous topic - Next topic

moviemaker445

Hi Mario,
I wonder if you could point me in the right direction regarding a problem I have with 'clearing' the 'Country', 'State/Province', 'City' & 'Location' metadata fields.

Composite\MWG-Country\Country\0
Composite\MWG-State\State\0
Composite\MWG-City\City\0
Composite\MWG-Location\Location\0

In the past, I used a geocoding app to reverse geocode many images and unfortunately the entries placed in the four location fields mentioned above are often obscure or meaningless to me.
I would rather they be 'empty' than contain confusing information.

When I clear the entries in these 4 fields using the Metadata Panel, they show as empty on the Metadata Panel, but when I write-back the Metadata changes, the previous entries reappear.

I have the IMatch Metadata2 Preferences set as follows:
Protection > Protect existing XMP = NO
Settings > Keep existing XMP = No

Can you please tell me what I should do to make sure the fields are completely 'cleared' ie empty. (I have attached a file that suffers from the problem)

Kind Regards

Mario

For this particular file, I had to

a) Delete the location entries (green) in the "Default" Metadata Panel layout and
b) Switch to the IPTC Location layout and delete the "Location Shown" entry as well.

The file contains XMP and legacy IPTC metadata which doubles the location info, and ExifTool seems to retain one set of data when I delete only the composite tag values or IPTC location shown.

Strange effect. I need to look into this at some time, figuring out what in the XMP to IPTC and Composite mapping causes this in ExifTool.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

moviemaker445


moviemaker445

After a bit of trial and error, I have found that the issue seems to involve the following fields when a Metadata Write Back is performed on the file:

Composite\MWG-Country\Country\0
Composite\MWG-State\State\0
Composite\MWG-City\City\0
Composite\MWG-Location\Location\0

AND

XMP::iptcExt\LocationShownCountryName\LocationShownCountryName\0
XMP::iptcExt\LocationShownProvinceState\LocationShownProvinceState\0
XMP::iptcExt\LocationShownCity\LocationShownCity\0
XMP::iptcExt\LocationShownSublocation\LocationShownSublocation\0


Editing an entry in a 'Composite' field updates the corresponding 'XMP::iptcExt' field and vice versa
Adding a new entry if both are blank, causes both to be filled.

However, emptying ONLY the 'Composite' or 'XMP::iptc' fields causes that emptied field to be refilled with the entry in the other, when a Metadata Write Back is performed on the file .

Emptying BOTH Composite and XMP::iptc fields produces the result I am after.

 
I have come up with a workaround for this using a custom Metadata Template containing all eight fields and if I want to completely delete information, I make sure that I delete entries in both Composite and XMP::iptc fields before doing the Metadata Write Back.

Problem solved. :-)

HaWo

Ich hatte ein ähnliches Problem. Hier meine hinterlegte Notiz dazu:


im357 Löschen von Ländercode und Land
02.08.2023 / 30.08.2023
─────────────────────────────────────────────────────────────────────
Im Dashboard die Anzeige unter 'Länder' wieder entfernen.

Da im Metadaten-Panel 'Location' der Eintrag bei 'Land' nicht löschbar ist (erscheint nach dem Zurückschreiben immer wieder) folgenden Ablauf benutzen:

Tags im Metadaten-Panel mit dem Eintrag für das Land suchen:
Metadaten > 0 Browser > Metadaten-Browser

Unter: XMP IPTC Extension
Feld : Location Shown Country Na...
Tag  : XMP::iptcExif\LocationShownCountryName\LocationShown...\0

oder:

Unter: XMP Photoshop
Feld : Land
Tag  : XMP::photoshop\Country\Country\0


Beispiel für Land: Türkei - siehe screenshot 'land'


Ablauf:
- Gewünschtes Land im Kategorie Verzeichnis anklicken
- Alles markieren
- Menü Werkzeuge > Metadaten-Vorlagen > Remove Ländercode + Land
  anklicken ('Land' wird nicht gelöscht!)

dann:
- Metadaten-Panel öffnen
- In den beiden oben angegebenen Tags jeweils den Text bei 'Land'
  (hier Türkei) manuell löschen
- Zurückschreiben und Aktualisieren lassen
- Warten *)
- Nach einigen min. wird im Kategorie-Verzeichnis das Verzeichnis
  für das entsprechende Land gelöscht


Ist für Dich vermutlich uninteressant:

*) Zwischendurch mal '1 Standard' öffnen und dann wieder zurück auf
  '0 Browser'. (Sieht aus, als ob der Vorgang dadurch wieder ange-
  schubst wird?).
  Wenn das Verzeichnis gelöscht ist werden die Bilder manchmal immer
  noch angezeigt, dann auf 'Dashboard' umschalten und wieder zurück.
  Anzeige wird neu aufgebaut - leer.

Da das alles z. Zt. zu umständlich ist, die IMatch Standardkategorie 'Land' nicht verwenden - dafür Kategorie @Keywords benutzen.
Hans-Wolfgang

HaWo

Ergänzung zum obigen Post.

Meine Metadaten-Vorlage sieht so aus und löscht das Land nicht.

Wenn ich die Lösung von moviemaker 445 betrachte, fehlen bei mir einige Tags.

Meine Tags sind die, die unter 'Location' im Metafaten-Panel angezeigt werden.

Vielleicht sind meine Infos für Dich nützlich.
 
Hans-Wolfgang

mopperle

@HaWo hopefully Google, or whatever he will use, translates correctly what you have written ;)

HaWo

Hallo mopperle, ja, ich denke (hoffe) schon. Bei Mario habe ich keine Bedenken , habe leider vergessen ihn direkt anzusprechen.
Hätte ich besser formulieren sollen.
Hans-Wolfgang

Mario

I did put a bit of work into this...aaaand...it's, slightly, complicated.  :(
Don't mind the typos!

There are many implicit inter-dependencies between location-related tags in XMP, EXIF GPS, legacy IPTC, Photoshop XMP, IPTC Core and the dynamic Composite tag ExifTool makes up on-the-fly from various of these tags.

For example, take the City tag.
It exists as

XMP::iptcExt\LocationCreatedCity\LocationCreatedCity (repeatable, can have many City values)
XMP::iptcExt\LocationShownCity\LocationShownCity (repeatable, can have many City values)
Composite\MWG-City\City (only one City)
XMP::photoshop\City\City

GPS Lat/Lon/Alt exist in both Created and Shown variants in XMP and GPS, except for Altitude, which exists only in a Created variant in GPS (and so also in Composite).

XMP::photoshop also has a tag for County and State but none for Location.
IPTCExt has also XMP::iptcCore\CountryCode\CountryCode and XMP::iptcCore\Location\Location, but none of the other location tags.

All this has to be somehow synchronized during write-back, where possible.
Additional complexity comes from the fact that the now preferred LocationShown and LocationCreated structured tags can appear any number of times in a file, which the other tag groups can only hold one instance for a tag.

Also, IMatch users can choose to enter a City in any of the City tags.
Many use Composite\MWG-City\City, because its easy and shown in the "Default" MD Panel layout.

And there is reverse geocoding, which either delivers created or shown or created and shown, depending on what the user wants.

Sigh.

ExifTool does 'a bit' of synchronization between Composite and XMP/GPS/IPTC tags, but not all.
The dependencies between the various "location" tags in various tag groups and metadata standard are implicit rather than explicit. The late MWG specification and the IPTC give some pointers (sometimes vague) where to put what and how to synch this.

Note: Most applications out there don't give **** and just set / update whatever tag they find most easy - causing often severe issues for users who switch to other software of have to work with a variety of applications. One of the reasons why so many stick to an Adobe workflow for all creators and clients.

Anyway, I digress.
I have extended an (not really often used) concept that is in IMatch for a while and that are liked tags.
Basically, this allows me to link certain tags in the metadata config file and e.g. tell IMatch "When the user updates XMP::iptcExt\LocationShownCity\LocationShownCity, also update Composite\MWG-City\City  and XMP::photoshop\City\City.

(Long-winded but fascinating explanation of how this all works removed).

The end result is that IMatch is now "better" and somehow managing this melange of related location tags.
For example, adding / changing  / deleting (emptying) XMP::iptcExt\LocationShownCity\LocationShownCity now propagates these changes into the other mentioned tags during write-back or even in the database for immediate feedback.

The Alt in Composite is always filled from the "Created" location tags. This is how ExifTool does it.
Attempts to link some tags in the database were fruitless or even harmful, because ExifTool suddenly duplicated tag values and I've ended up e.g. with entries like "London;London;London" in the Composite City Tag (this comes from an implicit sync between IPTCExt City and Composite City during metadata extraction, I believe.

@moviemaker445

To delete the location data entirely, it is now sufficient to just delete the corresponding LocationShown XMP tag in the "Location" Metadata Panel layout. This also deletes the Composite / Photoshop / IPTCExt tags during write-back.

Metadata is a mess and a never-ending chain of historical "debt" and attempts to somehow make all the various metadata standard versions used over the past 30 or 40 years somehow "work".
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

cg

I think this is related to something I'm experiencing now, which has not been a problem before. I have about 1200 jpg files (no proprietary formats) that have the metadata updated at some point using a previous version of iMatch (from one month ago and earlier) but not written back.

Before, I would enter values for:

Composite\Location (Composite\MWG-Location\Location\0)
Composite\City (Composite\MWG-City\City\0)
Composite\State (Composite\MWG-State\State\0)
Composite\Country (Composite\MWG-Country\Country\0)
XMP::iptcCore\CountryCode  (XMP::iptcCore\CountryCode\CountryCode\0)

and write back successfully.

Now, when I write back the metadata for these files, all of the data for the above tags except country code is lost.

I see that when data is newly entered into those fields in the current version of iMatch, iMatch also updates:

XMP::iptcExt\LocationShownSubLocation
XMP::iptcExt\LocationShownCity
XMP::iptcExt\LocationShownProvinceState
XMP::iptcExt\LocationShownCountryName
XMP::iptcExt\LocationShownCountryCode


So to solve the problem of losing the metadata on writeback, I've created a metadata template that copies the data from the Composite\ tags to the XMP::iptcExt\ tags, which seems to work on the few files I've tested it with so far.

Is this expected behavior? Or does this point to a configuration error in my setup? And are the behind-the-scenes tag updates in iMatch something new, since this hasn't posed an issue before.

Thank you!




Mario

Try this with the IPTC Location Metadata Layout. It shows you the Location created and location shown metadata.
If you don't see this layout, see the release notes for IMatch for more information.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

QuoteIs this expected behavior? Or does this point to a configuration error in my setup?
Don't know. Never reported before.
Please open the output panel (View menu > Panels) and then make the normal change and write-back.
Copy the contents of the output panel into Windows Notepad, save to a file and attach.

This will show us which tags IMatch is writing and if there are maybe some issues reported by ExifTool.
You can also send me one of the files (before write-back) to support email address (with a link back to this topic) so I can run some additional tests here.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook