span8
span4
教程:地理数据库转换|Previous: Feature-Linked Annotation|Next: Writing Relationship Classes
上面的视频覆盖理论本文中介绍,和写作的ArcGIS地理数据库附件例
地理数据库关系类用于与其他功能来管理一个要素类特征之间的关系。归因和非归属关系类可以读取和写入FME。关系不是通过始发地和目的地功能的主键和外键的值像其他许多功能表或要素类的行,但联系。
“起源”的特征属于创建在ArcCatalog关系类时所指定的“产地表/要素类”,而“目标”功能属于“目标表/要素类”。
关系类可以是简单的或复合材料,以及归因或非归属。
有关ArcGIS中关系的详细信息,请参考:https://desktop.arcgis.com/en/arcmap/10.7/manage-data/relationships/relationships-and-arcgis.htm
请注意,使用的ESRI文件地理数据库读/写/这篇文章中提到,需要ArcGIS的行货版本..有关要求ArcGIS许可级别的详细信息,请参阅Required ArcGIS License Types for FME Geodatabase Formats.该Comparison of FME readers and writers for SDE and Geodatabase也可能是有用的。
相关的例子是可用编写地理数据库关系类
简单对比综合:
在“简单”的关系类,特征可存在彼此独立地 - 例如一个特征可以,而不必具有连接存在,任何附接可以在不影响功能被删除。
在“复合”关系类,始发地和目的地对象的结合更加紧密。如果一个功能被删除,以便也将是相关附件记录。
归因与非归属:
在非归属关系,关系类包含在非空间表格只包含出发地和目的地的功能键。
在一个归属关系,该关系类包含在非空间表不仅仅是标识键更多的属性。
阅读关系类
当读取一个关系类,两者的出发地和目的地的要素类必须同时作为关系类阅读。的关系特征类型节目的允许几何任geodb_relationship要么geodb_attributed_relationship。
每个关系的功能已经从一个关系类阅读下面的格式属性存储在其上:
这些属性可以用来识别工作区中的起点和终点特征之间的关系。这些属性用于FME的过程,格式属性,并不会出现在最终的书面输出。
性能
请注意,从关系类阅读,因为阅读时,每个关系被验证是很慢的。因为此功能是不是经常需要,FME包括参数,默认情况下,关闭关系阅读来提高性能。因此,阅读类的关系必须first locate and deactivate the "Ignore Relationship Info" parameter.
写作关系类
Relationship classes cannot be created through FME and must be set up through ArcGIS prior to running the translation.Once the relationship has been defined in ArcGIS, the following attributes must be stored on features written to a relationship class table in FME (这仅涉及到M:N和归属,因为你直接的关系表进行交互关系):
该 following attribute must be stored on features written to the origin and destination feature classes/tables which participate in the relationship (this applies to all types of cardinality (1:1, 1:M, M:N and attributed)):
注意:
Required attributes for writing to relationship classes:
Object | Required Attributes |
Origin feature class or table | geodb_oid geodb_feature_has_relationships =yes |
Destination feature class or table | geodb_oid geodb_feature_has_relationships =yes |
Relationship class | geodb_rel_origin_oid geodb_rel_destination_oid geodb_type =geodb_relationship要么geodb_attributed_relationship Table Handling:Use Existing |
For example, if an origin feature has geodb_oid = 1 and a destination feature has geodb_oid = 2, the feature written to the relationship table must have these attributes:
geodb_rel_origin_oid = 1
geodb_rel_destination_oid = 2
关系:插入,更新或删除
Note that features participating in an归属关系can be inserted, updated and deleted.But features participating in a非归属关系can only be inserted and deleted.Because attributed relationships have intermediate tables associated with them, the attributes of the intermediate table (excluding key values), may be updated by providing an RID (relationship id) as an update/key field.
In a geodatabase, the relationship keys do not have to be of type Object ID (integers).该y could be a GUID for example.In this case, it's tempting to load the foreign key attributes in the relationship.You don't need to do this.You only need to set the values of geodb_rel_origin_oid & geodb_rel_destination_oid.该 FME Geodb writer will populate the relationship feature class foreign keys.
仅使用一个地理数据库的作家:Be careful if you have more than one Geodatabase writer in your workspace.该 origin and destination feature classes (or tables) that participate in the relationship and the relationship class must be written by the same Geodatabase writer (i.e.you cannot write to feature classes with one Geodatabase writer and to relationship classes with another).
Sometimes, the data in the origin and destination feature classes already exists and you just want to添加关系to the relationship table.You can do this if:
- the relationship is M:N or an attributed relationship
- the relationship class already exists in your geodb
Set the geodb_type to geodb_relationship or geodb_attributed relationship (if attributed) and the geodb_rel_origin_oid and geodb_rel_destination_oid to their respective OBJECTID's.This does require that FME reads the feature classes which participate in the relationship but does not involve writing them out again.Only the relationship table needs to be written to in this case.
关系背景
Relationships must be created using the ArcGIS tools, as they cannot be created in FME.
1:1,1:M无属性关系:该se have no intermediate table for keeping track of relationships.该y are linked using a primary (origin table) and foreign (destination table) key.
M:N和任何1:1,1:M或M:N属性关系:Separate tables are used to keep track of the relationships.In order to track these relationships, each relationship entry contains a unique RID value along with the primary and foreign key.
文件地理数据库和地理数据库SDE:
1:1,1:M非归因要素类:If inserting with FME you would either be starting with empty feature classes (because as soon as you create the relationship in ArcMap, the relationship is already completed), or you would be deleting and re-inserting features which participate in the relationship and thus rebuilding that relationship.
文件地理数据库ONLY - 没有SDE地理数据库:
1:1,1:M,M:N归因关系和M:N非归属关系:If you have populated feature classes and need to insert into the relationship table to populate it, or you want to update or insert attributes in an attributed relationship table, you may simply insert into the relationship table directly without writing to the feature classes which participate in the relationship.This includes the primary/foreign key and/or attributes.该 assumption here is you already have a table or some source with those relationships defined.It's probably a less common workflow but it's doable and perhaps a good advanced post or just something we add to one of the articles as an aside.Generally, you will be inserting to both the feature classes and building/inserting into the relationship table at the same time.
SDE地理数据库:
1:1,1:M,M:N归因关系和M:N非归属关系:
FME may only be used to UPDATE the attributes in an attributed relationship, not the RID, foreign and primary keys.If this is desirable, a DELETE and INSERT operation must be performed.
Currently, there isn’t a way to insert existing relationship attributes into a relationship table with a SDE Geodatabase without reading the features participating in the relationship in order to get the ObjectID.This is in part because populating these relationships in ArcGIS requires the origin and destinations to be picked interactively rather than just defining the relationship.因此,如果其参与的关系类的特点,在数据库中,只有关系表的需求已经存在填充,其参与的特征仍然必须阅读。这是必需的,以获得对象ID的,然而这些功能不被写回。从出发地和目的地的关系特征的对象ID的读取将需要被重新命名为geodb_rel_origin_oid分别以geodb_rel_destination_oid对于要填充关系表。
多了几分删除记录的一个关系类...
您可以从一个关系类中删除单个记录。要做到这一点,您可以:
©2020安全亚搏在线软件公司|法律