span8
span4
span8
span4
A subtype defines aspects of a Geodatabase schema that relates to data classification.In other words,instead of creating different feature classes for a set of features,a subtype functions as a way to define a subset of features within an individual Geodatabase feature class.An attribute in the feature class stores integer values that define the subtype,and a subtype table contains definitions for the corresponding integer value.For instance,a table named "Road" may have an attribute field called "Condition",whose values map to a subtype containing values good,moderate,and bad.
In general,each table can have only one subtype,all codes must be unique and be valid integers,and all code:description pairs must be unique.
It should be noted that a subtype is specific to a particular feature class.Therefore,it cannot be shared by other feature classes in the Geodatabase in the way that a domain can be shared.
When reading a Geodatabase,FME has an option to "Resolve Subtypes".
When this option is checked,the format attributegeodb_subtype_namewill be populated with the descriptive value contained in the subtype definition.
Note : If you can,we would recommend using a Geodatabase Template as describedhere.This is generally easier and more flexible than defining subtypes within FME feature types.
Due to the fact that a subtype can only apply to a single feature class,it is not possible to create a new table and associate it with an existing subtype.As such,when writing Geodatabase subtypes,the 亚搏在线workflow requirements will fall under one of two scenarios:
The above scenarios will be controlled primarily by the following parameters:
- 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.For more information on importing an XML document with a schema,please see theGeodatabase Writer documentation.
Scenario 1: Writing to an existing table containing an existing subtype
No additional work is required to write to an existing table with an existing subtype.It's not even necessary to set the writer parameter "Validate Features to Write" in order to validate subtype value.A feature with an undefined subtype value will be rejected anyway,with the following error:
For the '
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.However,creating subtypes is possible with FME.The process is to define an attribute for use as a subtype,setting that attributes data type to eithersubtypeorsubtype_codesin the schema definition of the destination Geodatabase.
Thesubtype_codesdata type allows the user to define a code number and description for the subtype.Its edit dialog looks like this:
Any attribute that does not adhere to one of the defined values will result in the translation failing with an error.
Thesubtypedata type has only a single field in its editing dialog:
FME will create a unique code number for each incoming value.This option might be useful when you do not know what particular values the incoming data might hold.
Limitations
At the time of writing,FME will not allow you to associate different domains based on a particular subtype.For instance,you would not be able to set range domains of 0-50,000;50,000-100,000;100,000-250,000 and apply them to a subtype definition containing the values of Small,Medium,and Large.In order to achieve this,you would need to create the domain:subtype relationship in ArcGIS.
The following example demonstrates Scenario 2: Writing to a new table and creating a new subtype.
Parks (MapInfo TAB - MITAB)
In the above image,we see a visualization of the source Parks MapInfo TAB file with the corresponding data and attributes.
1.Read Source Data
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.Calculate Area & Map Area to Subtype Codes
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.The value for the calculated area will be stored in an attribute named_area.
The AttributeRangeMapper will be used to map values coming from the _area attribute (created with the AreaCalculator) to the subtype codes we will apply to the subtype definition.The code applied will be based on whether the initial values fall into a specified range.Add the AttributeValueMapper to the canvas and open the parameters dialog.Select _area as the Source Attribute and for Output Attribute type in "ParkSize".For the Range Lookup Table,enter the following values:
From | To | Output Value |
10,000 | 1 | |
10,000 | 1,000,000 | 2 |
1,000,000 | 3 |
When complete,the AttributeRangeMapper parameters dialog should resemble the following image:
3.Write Features & Create Subtype
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.Subtypes).Once added,double click on the writer and,under the General tab,set the geometry to be geodb_polygon using the drop down menu.Next,click on the User Attributes tab and,under Name,add an attribute called ParkSize and set the Type to subtype_codes.
Click on the Edit button and the Subtype Codes dialog window will open.Enter the codes and corresponding descriptions for the subtype definition.
Click OK and then save and run the workspace.
* The ESRI Geodatabase (File Geodb
) reader/writer used in the above example requires that a licensed version of ArcGIS be available to the user.For more information on required ArcGIS license levels,please seeRequired ArcGIS License Types for FME Geodatabase Formats.
Writing ArcGIS Geodatabase Attachments
Viewing and Inspecting Geodatabases
Introduction to Working with Geodatabase Relationship Classes
Tutorial: Getting Started with Geodatabase
Writing Geodatabase Relationship Classes
Working with Geodatabase Field Aliases: Altering Alias Values
Working with Geodatabase Metadata: Writing/Updating Metadata
Geodatabase Behaviour: Updating a File Geodatabase
© 2019 亚搏在线Safe Software Inc |Legal