Question

Writing MapInfo TAB metadata tags

  • 15 December 2015
  • 3 replies
  • 1 view

Badge +10

Back in 2012 I answered a question, which has a similar flavour to a question I have today.

https://knowledge.safe.com/questions/5410/mapinfo-seamless-table.html

Sadly back then FME couldn't easily solve the problem and as far as I can tell it still can't?

I'd like to be able to write metadata tags into MapInfo TAB files with FME, so that a process can be fully automated. As far as I know, the two MapInfo writers don't have any options for this to date.

At the moment my train of thought is pursuing the angle of writing the TAB files out as normal and then running another FME Workspace to open the .tab file as text and appending the metadata tags as required. The metadata is extracted from an excel sheet, so this should be achievable. Anyone got any smarter ideas?

Metadata tags look like this in MapInfo TAB files for reference and are appended to the bottom of the *.tab file:

begin_metadata

"\\IsReadOnly" = "FALSE"

"\\MapInfo" = ""

"\\MapInfo\\TableID" = "12345678910"

"\\Company\\" = "1Spatial"

"\\Responsible Party" = "Anyone except me"

"\\Version" = "1"

end_metadata

Cheers, Dave


3 replies

Userlevel 4
Badge +13

Sadly, the best option is to do as you suggest and inject these as a post process. If you can use FME 2015, I'd suggest the FeatureWriter to write out the TAB file, then afterwards use an AttributeFileReader to bring back the TAB file itself, then inject the metadata you want, and an AttributeFileWriter to replace the TAB with your new one. There's a chance we'll be doing significant work in MapInfo readers/writers in calendar 2016, and will keep this in mind as we do, but that won't see release until FME 2017 most probably.

Userlevel 2
Badge +12

Cann't you use a txt writer to write to a TAB file and append the requested information in a separate process (as Dale suggested as postprocessing) or even with two WorkspaceRunners?

Badge +10

Sadly, the best option is to do as you suggest and inject these as a post process. If you can use FME 2015, I'd suggest the FeatureWriter to write out the TAB file, then afterwards use an AttributeFileReader to bring back the TAB file itself, then inject the metadata you want, and an AttributeFileWriter to replace the TAB with your new one. There's a chance we'll be doing significant work in MapInfo readers/writers in calendar 2016, and will keep this in mind as we do, but that won't see release until FME 2017 most probably.

Thanks, I'll watch this space.

Reply