Escolar Documentos
Profissional Documentos
Cultura Documentos
Relationship Classes
A review of recent course evaluations for our most popular geodatabase
Web course revealed a lot of confusion over the terms "relate" and
"relationship class." Both are covered in the course, and the confusion is
nothing new. In fact, it's been an issue ever since ESRI introduced the
geodatabase. In this post, we'll attempt to clear it up.
The Basics
A relationship class is an
object in a geodatabase that stores information about a relationship
between two feature classes, between a feature class and a nonspatial
table, or between two nonspatial tables. Both participants in a relationship
class must be stored in the same geodatabase.
The Example
In the Table of Contents in the map above, you see a layer of city fire
stations and a nonspatial table that stores data about the city's fire
department personnel. A table relate has been created between the layer
and the nonspatial table based on a short integer field in each table that
stores a fire station ID number.
Below, you see the attribute table for the fire station layer and the fire
personnel table. The option to show only selected features is being used for
both tables. Notice that while only one fire station record is selected (the
Washington station), six records in the fire personnel table are selected.
This tells you that the Fire Stations layer has a one-to-many cardinality with
the fire personnel table. For each fire station, multiple fire personnel are
associated. In this case, six firefighters are assigned to the Washington
station. Because the tables are related, when you select a station you can
easily find out who works at the station. Table relates are bi-directional,
which means you can also select a record in the fire personnel table and
access the name of the station to which the firefighter is assigned.
You don't even need to select a feature or open the tables; you can quickly
view the information by using the Identify tool. The name of the related
table displays under the feature name on the left side of the Identify
window. Expanding the related table reveals the related records. Clicking a
related record displays the data stored in the related table.
Table relates are very useful for accessing and viewing information about
the real world that is actually stored in two different tables. Relationship
classes offer more powerful capabilities, however.
At the end of the table relate example, the Washington station had five
assigned firefighters. Now, with the relationship class in place, if a staffer
tries to assign a different station number to one of the Washington station
firefighters, an error message will display and they won't be able to edit the
station number. They will have to assign a new firefighter to the
Washington station before editing the fire station number for the existing
Washington station firefighter.
The relationship class ensures that data edits are valid and supports the fire
department's goal that personnel assignments comply with the city's
requirement.
Remember
A lot more could be said about relates and relationship classes, but in the
interest of simplicity we will end the post now. Hopefully, some of the
confusion has been dispelled. For more information, check out theArcGIS
Desktop Help topics on relationships.
Comments
Yes, you are correct. With an ArcView license you can view relationship
classes but you need ArcEditor or ArcInfo to edit a feature class that
participates in a relationship class. Talk to your GIS manager or system
admin--it may be possible to use a floating ArcEditor or ArcInfo license if
you need to edit data that has relationships.