In the esri geodatabase, what is the difference between Simple and Attributed relationship classes?
[GIS] difference between Simple and Attributed relationship classes
esri-geodatabase
Related Solutions
The reason that people organize data in separate tables is because of Database Normalization principles (follow the link, all the rationale is there). That being said, ESRI Relationship Classes are a GeoDatabase-level implementation of a those principles. Honestly, I would personally only use them in two instances:
when you have some data that is normalized in the DB and you want to leveraging ArcMap editing tools. ArcMap allows you to (arguably) easily traverse the relationships in their tools.
when you are using a GeoDatabase abstraction that is in need of the GeoDatabase messaging (e.g feature-linked annotation, custom feature classes, etc).
Although people may claim that referential integrity is one of the benefits, the truth is that it can be circumvented with a SQL prompt, so the benefit of this really depends in the workflow that you have for modifying that (i.e do people use only ArcMap to edit vs do people also edit with SQL queries or non-ESRI tools).
Based on your additional notes it sounds like you will want to use the IRelationshipClass.GetObjectsRelatedToObject
method, at least for starters.
For better performance you might consider using one of the other methods, such as GetObjectsRelatedToObjectSet
that takes a set of input objects though. This will reduce the number of round trips to the database if you are doing this in batch.
Additionally if you want to specify a QueryFilter over a given set of input objects (this might not be necessary if your cursor is already being filtered), take a look at IRelationshipClass2.GetObjectsMatchingObjectSetEx
.
For code examples I would suggest searching the ESRI forums (new and old), as well as this site: Example search
Some relevant results:
- Problems using IRelationshipClass::GetObjectsMatchingObjectSet
- Is this as efficient as it gets?
- Bad data beaking IRelationshipclass.GetObjectsRelatedToObjectSet
- ESRI: ADF + Geodatabase
- Troubleshooting ArcObjects performance problems
Without having a relevant sample dataset I am reluctant to write a code example myself. Perhaps you could upload an ESRI XML Workspace document for a subset of your data, and describe the desired user interaction workflow, inputs and outputs.
Also refer to the available documentation:
- ArcGIS Desktop Help topic on relationship classes
- The
IRelationshipClass
andIRelationshipClass2
interfaces - Object Model Diagrams (OMD) for the Geodatabase library (PDF)
- "Creating relationship classes" topic (even though you've already created them)
(source: arcgis.com)
Best Answer
Slightly edited snippet from a conversation in the GDAL/OGR Mailing list: