Copy Metadata into Categories

Started by CMinguell, March 29, 2017, 03:05:06 PM

Previous topic - Next topic

CMinguell

Hi,

I have many old files with hierarchical location info in the IPTC field "Instructions" and I want to copy this info as hierarchical categories.

For example: an image with España;Canarias;El Hierro;El Desierto in the "instructions" IPTC fields must be assigned to the categories Location|España|Canarias|El Hierro|El Desierto

Some files has location info in this IPTC field, but other files has another info in the same field, or the hierarchical location info is in other IPTC filed, so I think that the Data Driven Categories are not useful, because I need to select the specific files, the source Metadata and the destination categories, in a similar way I can do the opposite (Categories into Metadata) through the "Metadata Templates"

How can I do it?

many thanks and best wishes,

Carlos

Mario

A very unusual and complicated problem.
Definitely your metadata needs some cleanup  ;)
Good that you have IMatch.

Two things to try:

1. You can use a filter for your data driven categories. If you can find something unique that allows you to tell which IPTC instructions contain location data and which do not. Maybe the ; ?

Or

1. Assign all the files with "good" location data in IPTC instructions to a category manually.
Most likely the IMatch Filter Panel will do a good job (Metadata Filter on the IPTC Instructions tag).

2. Create a data-driven category on IPTC Instructions, but use the category created in step 1 as the filter.
This way the data-driven category is only created from files which you have identified as containing proper location data.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

CMinguell

Hi Mario,

Many thanks for your quick replay!

Yes, you are right... I have a lot of dirty metadata. This is because there are old files from several Imatch 3.6 databases and from other sources :P

I have tried what you said on #2: on this way I have the new location categories created under "Location" and each file assigned to the right one, but all the previous categories I had created under "Location" (With thousand files assigned) have been deleted  :-[

What I'm doing wrong?

Mario

Creating or updating a data-driven category cannot change other categories.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

CMinguell

#4
I will try to explain:

I have one category "Localizacion" (Location) with several subcategories (First level Countries, second level Regions, etc.) There are more than 25000 images assigned to these subcategories. You can see a screenshot of my categories before creating the Data Driven (categorias_1.png).

Now I have 2067 images from Mexico with the location info in the IPTC "Instructions", so I assign all these files to a category called "Mexico 2014" and make "Localizacion" a Data Driven category, using "Instruction" as TAG and "Mexico 2014" as CATEGORY FILTER. I activate DETECT HIERACHIES also.

When I enable the Data Driven category, the location info is recreated under the "Localizacion" category and the 2067 images assigned to their right categories... but all the other old categories under "Localizacion" have been deleted. You can see a second screenshot with the categories tree after that (categorias_2.png).

I don't know if I did something wrong creating the Data Driven...






Mario

This sounds correct.

You create a data-driven category from 2067 images and this is what you get.

A data-driven category has only one "source/imput".

When you set it to use the "Mexico 2014" as a filter, it will only use the files in that category.

If you have created the category from other metadata before (to get the 20K+ images), this will of course remove all these files.

The default IMatch sample category "Location" is produced from real location data: XMP country, city and location.
If you change that category to use your IPTC instructions and the filter, these files will of course all vanish.

I suggest you try to transfer your location data out of the IPTC instructions into the proper XMP country/city/location fields and stop using IPTC instructions to hold location data.

I don't know how many different values you have in the IPTC instructions, but would it no be easier to just sit down and add GPS coordinates to these files? IMatch will then lookup counry/city/location automatically, all data-driven categories will work automatically etc.

Even if you have 100 different locations in the IPTC descriptions, it should only take a few minutes to select them via a Filter, add GPS data in the Map Panel and get over with this. Then delete the old data from the IPTC tag.



-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

CMinguell

OK. These is why I thought that Data Driven would not work for me   :-\

What you suggest about GPS location is pretty smart and will work in most cases, but for the oceanographic campaigns I work, my customer needs the name they give to a specific dive as location, for example:

Localizacion|Suecia|North Sound|Sound ROV 4

By other hand, I'm underwater photographer and, in most of the images, the last level of "Localizacion" categories is the name of a dive point.

So those are "virtual" locations names and I can't select them in a map  :(

I suppose that there is not a script able to do the same that the "metadata Templates", but from metadata to categories, isn't it?

Many thanks for your help Mario.

best wishes,

CMinguell

thinking about it...

I have this in the IPTC "Instructions" of an image:

Suecia; Oresund; North Sound; Sound ROV 4

May I use the Metadata Template to get this values from the image?:

{File.MD.XMP::iptcExt\LocationCreatedCountryName\LocationCreatedCountryName\0} =  Suecia
{File.MD.XMP::iptcExt\LocationCreatedProvinceState\LocationCreatedProvinceState\0} = Oresund
{File.MD.XMP::iptcExt\LocationCreatedSublocation\LocationCreatedSublocation\0} =  North Sound
{File.MD.XMP::iptcExt\LocationCreatedLocationName\LocationCreatedLocationName\0} Sound ROV 4

If yes, How should I do it?


Mario

You can always geo-code and then change the sub-location manually as needed.
This gives you proper GPS data and the custom location data you require.

Note: If you change these tags manually, make sure you disable automatic reverse geo-coding in the map panel. Otherwise you may replace your custom location data accidentally with standard data when you change the GPS coordinates of a file in the map panel.

As always which such custom schemes, give it a try with some of your files.
Then check the data in IMatch, write back the file to see if ExifTool puts all the data where it belongs.

The "Location Shown" is a complex XMP tag. It does not consist of individual fields but is actually a complex structure of many fields. ExifTool and IMatch try to make it look simple, allowing you to edit each field like other fields. When the data is written, the complex structure is created from the individual fields. You can see the full structure when you switch the Metadata Panel into the Browser layout.

After the file has been written, check it with all your other XMP-enabled software, your clients etc. to ensure that the data you create is compatible.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

CMinguell

OK, many thanks Mario.

Bests wishes,

Carlos