Friday, November 18, 2005

Associating Tabular Only Components with a Feature in FME

Depending on the complexity of your GIS data, you may or may not need to integrate complex data relationships into the GTViewer data you create. Safe Software’s FME is a very powerful tool for converting data to the GTViewer format, but there are many subtleties in the workspace design process that may not be readily obvious; one of them being the association of tabular only components to a feature with geometry.

This posting will touch on how you can relate non-graphic components (database records that are not associated with a specific geometry) to another feature that does have geometry. A good example of this scenario is data that contains Pole and Pole Attachment features. A Pole will have a record and geometry. A Pole Attachment will usually not have geometry and will be associated to an existing Pole. Also, there may be many Pole Attachments associated with a single Pole.

Let’s look at how the Pole feature is converted first with FME:

There are several ways to accomplish this task, but for simplicity, I have explicitly specified what the gti_key1 and gti_key2 properties are in the output. Normally, if these keys are not specified, FME will automatically populate them with appropriate values. Key1 will be a number associated with the feature, and Key2 will be a unique value for the individual feature. In this example, however, we want to make sure that we can associate the Pole Attachment records to the Pole, so the ObjectId is specified as Key2. Object Id is also the key field between the Pole Attachment and the Pole records in this example. Key1 is just explicitly set to a value so that we will know what it is for both the Pole and Pole Attachment records.

In this example, the source data is an ESRI geodatabase and Pole Attachments have a geometry point at the same location as the pole; however, we are just going to associate the tabular component to the pole and not have a graphic.

The Pole Attachement record has a POLE_OBJECTID attribute that tells which pole it is associated with. By assigning the POLE_OBJECTID to gti_key2 and setting gti_key1 to the same key1 value we used for the Poles, the records for the Pole Attachment will be associated with the Poles. The gti_type attribute is then set to gti_data to indicate that it will only have data and no geometry will be written for the feature.

To fully understand what this association means to GTViewer, the screenshots of an Attribute Info dialog below for a Pole should give a better illustration of why this process is useful:

By simply reviewing a Pole in GTViewer, you get both the Pole record and all associated Pole Attachment records. In this example, there are 2 Pole Attachments for the selected pole.

No comments: