斯潘8
span4
子类型定义与数据分类相关的地理数据库模式的各个方面。In other words,instead of creating different feature classes for a set of features,子类型用作在单个地理数据库要素类中定义要素子集的方法。要素类中的属性存储定义子类型的整数值,and a subtype table contains definitions for the corresponding integer value.例如,a table named "Road" may have an attribute field called "Condition",其值映射到包含值良好的子类型,moderate,and bad.
一般来说,each table can have only one subtype,all codes must be unique and be valid integers,所有代码:描述对必须是唯一的。
It should be noted that a subtype is specific to a particular feature class.因此,it cannot be shared by other feature classes in the Geodatabase in the way that a domain can be shared.
读取地理数据库时,FME可以选择“解析子类型”。
When this option is checked,格式属性geodb_子类型名称将填充子类型定义中包含的描述性值。
注释 : If you can,we would recommend using a Geodatabase Template as described在这里.This is generally easier and more flexible than defining subtypes within FME feature types.
由于子类型只能应用于单个要素类,无法创建新表并将其与现有子类型关联。As such,when writing Geodatabase subtypes,the 亚搏在线workflow requirements will fall under one of two scenarios:
以上场景主要由以下参数控制:
- Data Type: subtype / subtype_codes
- Validate Features to Write parameter: Yes / No
Despite the scenarios mentioned,it should be noted that using an XML Workspace document (containing the required subtype definitions) as a template on a Geodatabase writer,is an efficient and highly recommended means of writing Geodatabase subtypes.有关导入带有架构的XML文档的详细信息,请看Geodatabase Writer documentation.
场景1:写入包含现有子类型的现有表
No additional work is required to write to an existing table with an existing subtype.为了验证子类型值,甚至不需要设置writer参数“validate features to write”。A feature with an undefined subtype value will be rejected anyway,with the following error:
为了“
Scenario 2: Writing to a new table and creating a new subtype
It should be noted that we generally recommend that you use ArcGIS to create and define subtypes,using FME to enter subtype code values when inserting new features.然而,creating subtypes is possible with FME.The process is to define an attribute for use as a subtype,将数据类型属性设置为subtype或亚型码in the schema definition of the destination Geodatabase.
The亚型码数据类型允许用户定义子类型的代码编号和说明。其编辑对话框如下:
任何不符合定义值之一的属性都将导致转换失败并出现错误。
Thesubtype数据类型在其编辑对话框中只有一个字段:
FME将为每个输入值创建一个唯一的代码编号。This option might be useful when you do not know what particular values the incoming data might hold.
局限性
在写作的时候,FME will not allow you to associate different domains based on a particular subtype.例如,您将无法将范围域设置为0-50000;50,000-100,000;100000-250000,并将其应用于包含small值的子类型定义,培养基,大的。为了实现这一目标,您需要在Arcgis中创建域:子类型关系。
下面的示例演示 场景2:写入新表并创建新的子类型。
Parks (MapInfo TAB - MITAB)
In the above image,我们看到一个带有相应数据和属性的源parks mapinfo选项卡文件的可视化。
1。读取源数据
Park feature geometry is read from the source TAB file using the MapInfo TAB (MITAB) reader.The data in this file will be used to calculate Park area values that will be subject to the subtype definition in the destination Geodatabase.
2。计算区域并将区域映射到子类型代码
The AreaCalculator transformer is used to calculate the area of each polygon contained in the source data.Add the AreaCalculator to the canvas - the default parameters for the AreaCalculator will be sufficient.计算区域的值将存储在名为_area.
attributerangemapper将用于将来自Area属性(使用AreaCalculator创建)的值映射到我们将应用于子类型定义的子类型代码。应用的代码将基于初始值是否属于指定范围。将attributeValueMapper添加到画布并打开参数对话框。Select _area as the Source Attribute and for Output Attribute type in "ParkSize".对于范围查找表,输入以下值:
From | To | Output Value |
10,000 | 一 | |
10,000 | 一百万 | 2 |
一百万 | 3 |
完成时,attributerangemapper参数对话框应类似于下图:
三。编写功能和创建子类型
Add the ESRI Geodatabase (File Geodb) writer to the workspace,copying the schema from the reader and specifying the output Geodatabase to which the data will be written (i.e.亚型)。一旦添加,double click on the writer and,在“常规”选项卡下,set the geometry to be geodb_polygon using the drop down menu.下一步,click on the User Attributes tab and,under Name,添加一个名为parksize的属性,并将类型设置为subtype_codes。
Click on the Edit button and the Subtype Codes dialog window will open.输入子类型定义的代码和相应描述。
Click OK and then save and run the workspace.
*ESRI地理数据库(文件geodb
)上述示例中使用的读写器要求用户可以使用授权版本的ArcGIS。For more information on required ArcGIS license levels,请看Required ArcGIS License Types for FME Geodatabase Formats.
© 2019 亚搏在线Safe Software Inc |合法的