Creating a relationship class to link a feature class and a table |
Building Geodatabases |
Segment 3 of 3 |
Top Previous Next |
In Exercise 2, you saw how to import an INFO table containing owner objects into the Montgomery geodatabase. The geodatabase already has a feature class called Parcels that contains parcel objects. You will now see how to create a relationship class between the parcels and the owners so that when you use the data in ArcMap you can easily find out which owners own which parcels.
To create the new relationship class, right-click the Landbase feature dataset, point to New, then click Relationship Class.
The first panel of the New Relationship Class wizard is used to specify the name, origin, and destination feature class or table for the new relationship class. Type a name for the relationship. In this example the relationship is called “ParcelOwners”. To set the origin table click a feature class or table in the Origin table box. To set the destination table click a feature class or table in the destination table box.
The next panel is used to specify the type of relationship class you are creating. In this example the relationship class is a simple one, since owners and parcels can exist in the database independently of each other. You can, therefore, accept the default type—simple relationship class.
The next step is to specify the path labels and the message
notification direction. The forward path label describes
the relationship as it is navigated from the origin class to
the destination class—in this case, from Owners to
Parcels. The backward path label describes the relationship
when navigated in the other direction—
from Parcels to Owners.
In this example “owns” will be the forward path label and “is
owned by” will be the backward path label.
The message notification direction describes how
messages are passed between related objects. Message
notification is not required for this relationship class, so
accept the default of None.
The next step is to specify the cardinality of the relationship. The cardinality describes the possible number of objects in the destination feature class or table that can be related to an object in the origin feature class or table. This relationship will have 1–M (one-to-many) cardinality. This means that one owner may own many parcels. Click Next.
The next step is to specify whether the new relationship class will have attributes. In this example, the ParcelOwners relationship class does not require attributes, which is the default. Any relationship class —whether simple or composite, of any particular cardinality —can have attributes. Relationship classes with attributes are stored in a table in the database. This table contains at least the foreign key to the origin feature class or table and the foreign key to the destination feature class or table. An attributed relationship can also contain any other attribute.
The last step is to specify the primary key in the origin table (Owners) and the embedded foreign key field in the destination feature class (Parcels). Owners and Parcels that have the same value in these fields will be related to each other.