photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: kawaisunn on September 27, 2022, 07:00:34 PM

Title: Batch import tags and coordinates from MDB
Post by: kawaisunn on September 27, 2022, 07:00:34 PM
I have thousands of PDF files created from scans with no meaningful embedded metadata, but have a script to generate tags and records in an MDB with lat/lon coordinates. Is it possible to push file-embedded metadata from an MDB to the IMatch DB by filename?
Title: Re: Batch import tags and coordinates from MDB
Post by: Mario on September 27, 2022, 11:15:02 PM
What's a MDB? Microsoft Access database?

PDF files support embedded XMP data, and IMatch does as well (read and write).
I would suggest you do this in two steps:

1. Export the data you want to use into a CSV text file (comma-separated values).
Export the fully-qualified file name in column 1:

filename;lat;lon
c:\images\book1.pdf;0.234242;0.042242
c:\images\book2.pdf;0.235242;0.044242

2. Use the powerful CSV Import feature (https://www.photools.com/community/index.php/topic,12738.0/) in IMatch to import the data from the CSV into XMP GPS lat/lon, title, headline, description, keywords...whatever data you keep in your database.

For GPS, import into XMP::exif\GPSLatitude\GPSLatitude and XMP::exif\GPSLongitude\GPSLongitude
See Tags and Groups (https://www.photools.com/help/imatch/md_basics.htm?dl=tagsandgroups) and Metadata Tag ShortCodes (https://www.photools.com/help/imatch/md_shortcodes.htm) if you are new to IMatch. Let us know when you need more info.

When IMatch writes back the metadata, it produces a standard-compliant XMP record and embeds it into the PDF file.
This makes the data accessible for all other XMP-compliant applications, including Adobe products like Acrobat Reader.

IMatch will use the coordinates to locate the PDF files on the map, you can perform reverse geocoding, display the coordinates in File Windows, edit them in the Metadata Panel etc.
Title: Re: Batch import tags and coordinates from MDB
Post by: Jingo on September 28, 2022, 01:42:16 PM
I'm guessing here - but at work we often refer to MDB as a Maria Database... just another relational database and a variation of MYSQL..
Title: Re: Batch import tags and coordinates from MDB
Post by: Mario on September 28, 2022, 02:02:01 PM
The actual database system should make no difference, all databases can export "CSV files" in one way or the other.
This is the route I would go if this is a one-time operation.

If this is a continuous process, writing a PowerShell, Python or other script which pulls the data out of the database system and then uses the built-in IMWS in IMatch to store the data into XMP fields is very doable. See https://www.photools.com/dev-center/doc/imatch/ for information about how other applications and programming languages can access IMatch database contents.