Description


ArcGIS 10 supports the ability to add attachments to features in a geodatabase feature class. This is accomplished through the use of a table holding information about the attachment, the body of the attachment as a blob attribute and a relationship class joining the attachment to the geometric feature.

FME provides an easy way to load information into these attachments and build the relationship
class. This article demonstrates how to load photographs (i.e. JPEG images) into the attachment table and setup the relationship class entries with the associated point features.

Building the Attachment feature class

The attachment feature class has to be built using Esri's  ArcCatalog. In ArcCatalog use the right click option on a feature class and select "Attachments" > "Create Attachments"

This adds an attachment table with a fixed schema and a relationship class between the two feature classes. The names of these are all fixed.



Using FME to load the data

This example has a set of non-spatial features in an Access database which will be turned into point features (using the 2DPointReplacer) and loaded into the Emergency_Facilities feature class



In the Photos folder is a set of JPEG images which relate to this point data



The name of the image and the NAME_FULL from the Access file will be used to form the relationship.

This workspace also makes use of the Directory and File Pathnames Reader to read the directory holding the images and extract out information about them such as Filename, File Extension and File Size.




The workspace reads each of the source files and sets up the attributes required for writing to a relationship class. Then the data is written to the individual feature classes, the relationship is build and finally written to the relationship table. This same technique can be used to write to regular relationship tables.

It also seems to be necessary to delete the features and attachments using ArcToolbox tools rather than having FME truncate the tables. This could also be done using a Geoprocessing script as an FME Startup Python script.

Download the attached zipfile - Geodatabase_Attachments.zip to test out the process. The workspace uses data available from www.safe.com/FMEData