Happy Birthday to me, Happy Birthday to me!
Happy Birthday, to the Evangelist,
Happy Birthday to me!

OK, it’s not my personal birthday today, but this post is special because it is FME Evangelist number 100. That’s quite the milestone I think, since this started out as an internal newsletter back in mid-2007.

Anyhow, today’s post is another video evangelist. The highlight demo here shows how to use FME to attach files and images to features that are being translated to Esri Geodatabase. The trick is to use a relationship class and, if you haven’t used these before in FME, the video shows you how. I’ve also listed the steps below, as a quick way to access the information without listening to Aaron and myself witter on!

Other things we cover in the video:

So here’s the video. Don’t forget you can also find it on iTunes (M4V) and our FTP site (MP4, M4V and WMV).


ArcGIS Attachments
ArcGIS attachments are a way to connect additional information to Geodatabase features, in the form of a specific file; for example an image, a PDF, or a text document.

As the ArcGIS documentation mentions:

“For example, if you have a feature representing a building, you could use attachments to add multiple photographs of the building taken from several angles, along with PDF files containing the building’s deed and tax information.”

You can attach one or more files to a feature, and then retrieve the information using query tools in ArcGIS.

Attachments and FME
Because attachments are handled by a relationship class, FME is capable of easily creating this sort of connection. Attachments are added into a new table and FME can also create this. The key is to read the contents of the file to be attached into an attribute, and writing that attribute to a DATA field in the attachments table.

Here, in the workspace from the video, emergency facilities are read in and written out to a Feature Class. The location of PNG files are read with the FILEPATH reader, the AttributeFileReader used to read the file contents, and these too are written to their own Feature Class.

Notice that AttributeCreator transformers are used to create the attribute geodb_feature_has_relationships and set it to a value of Yes. This tells the Geodatabase writer that these features are part of a feature class. The Counter transformers create a unique ID (geodb_oid) for each feature.

Now comes the part where the relationship is created:

AttributeRenamer transformers are used to rename the feature geodb_oid to geodb_rel_origin_oid and the attachment geodb_oid to geodb_rel_destination_oid. These will be joined together into a single feature that contains both attributes – forming the relationship.

The join here is done with a FeatureMerger transformer:

The join is made (in this example) using the name of the photo file. An AttributeCreator then creates geodb_type and sets it to a value of geodb_relationship. This tells the writer that this feature is destined for a relationship class.

When the workspace is run each facility is written to a Feature Class, each attachment is written to a different Feature Class, and a record that joins the two is written to a Relationship Class. Then when you query a feature in ArcMap…..

…you get the image displayed.

I hope you found this – and the preceding 99 Evangelist posts – useful. Here’s to the next 100.


About FME ArcGIS Data Transformation Database Developer Tools FME Desktop FME Store Geodatabase Geoweb GIS KML Oracle Parallel Processing Python Safe Software Events Training Twitter World Tour YouTube

Mark Ireland

Mark, aka iMark, is the FME Evangelist (est. 2004) and has a passion for FME Training. He likes being able to help people understand and use technology in new and interesting ways. One of his other passions is football (aka. Soccer). He likes both technology and soccer so much that he wrote an article about the two together! Who would’ve thought? (Answer: iMark)


Comments are closed.

Related Posts