- ArcGIS for Desktop Cookbook
- Daniela Cristiana Docan
- 735字
- 2021-08-06 19:36:43
Creating subtypes
Subtypes are properties of feature classes or non-spatial tables. The subtypes gather the features from a feature class or records from a non-spatial table that share the same attribute values using an attribute field. The attribute field that groups the features must be of the data type Short or Long integer, and it will be named the subtype field. A feature class can have only one subtype field. You can assign different behaviors to individual subtypes from a feature class/table. Generally speaking, the behavior is defined by the actions or characteristics of features in a geodatabase. A subtype has a code and a description. After you have defined the subtypes for a subtype field, you can change everything related to a subtype: change the value or description of code, add more codes, and delete code. The subtypes help you in the geometry editing process and prevent errors when editing feature attribute values. The subtypes maintain the integrity in a geodatabase.
Getting ready
You will continue to work with geodatabase schema by grouping features from the feature classes that you created in the previous Creating a feature class recipe. The integer subtype fields are the following: BD
for Buildings
, HType
for Watercourse
and WatercourseL
, and CAT
for LandUse
.
How to do it...
Follow these steps to define subtypes using the context menu in ArcCatalog:
- Start ArcCatalog. In Catalog Tree, go to
<drive>:\PacktPublishing\Data\MyGeodatabase\ Topo5k.gdb\Buildings
. - Right-click on the
Buildings
feature class, and navigate to Properties | Fields. You will define five subtypes for theBD
attribute field. Select the Subtypes tab in the Feature Class Properties window. For Subtype Field, select the drop-down arrow and chooseBD
. In the Subtypes section, you have a default subtype with Code with the value0
and Description with the valueNew Subtype
. Change Description of the first subtype by typingUnknown
. - Continue to create subtypes as shown in the following table:
- For Default Subtype, choose the Dwelling subtype. Click on Apply and on OK. Open the Feature Class Properties dialog for the Buildings feature class to check the subtypes you just added. Right-click on the Buildings feature class, and choose Properties | Subtypes. You should see something similar to the following screenshot:
- In Catalog Tree, select the Hydrography feature dataset. Right-click on the
Watercourse
feature class, and choose Properties | Fields. Select the Subtypes tab in the Feature Class Properties window. You will define five subtypes for theHType
attribute field. For Subtype Field select the drop-down arrow, chooseHType
, and add the following subtypes: - For Default Subtype choose the River subtype. Click on Apply and on OK. Open the Feature Class Properties dialog for the Watercourse feature class to check the subtypes you just added.
- Repeat step 4 to create subtypes for the WatercourseL feature class using the same codes and descriptions.
- Repeat step 4 to create subtypes for the LandUse feature class using the CAT (Description:
Category
) attribute field and the following subtypes: - For Default Subtype, choose the Arable subtype. Click on Apply and on OK. Open the Feature Class Properties dialog for the LandUse feature class to check the subtypes you just added.
- Inspect the results in Subtypes in the Feature Class Properties dialog.
How it works...
The subtypes will help you to edit feature geometry and attribute fields faster. The default subtype is used as the default edit target for the Watercourse feature class when you start an edit session in ArcMap. In the Feature Class Properties dialog, you can add more subtypes for the BD attribute field, and you can delete a subtype or change Code and Description.
Sometimes, when you are establishing codes and descriptions for a subtype field, it is impossible to anticipate correctly all possible values. It is good practice to add code that covers all unforeseen values: Code: 42
and Description: Other terrains
. Another good practice is to add code that refers to the situation in which you know the values for all other attribute fields, but you are not sure about the subtype, and it will be defined later: Code: 0
and Description: Unknown
.
See also
- For information about how you can enforce attribute values for a feature class table, please refer to the following Creating domains recipe
- Data Visualization with D3 4.x Cookbook(Second Edition)
- ThinkPHP 5實戰(zhàn)
- Azure IoT Development Cookbook
- 網店設計看這本就夠了
- PHP+MySQL+Dreamweaver動態(tài)網站開發(fā)實例教程
- 焊接機器人系統(tǒng)操作、編程與維護
- Kotlin編程實戰(zhàn):創(chuàng)建優(yōu)雅、富于表現力和高性能的JVM與Android應用程序
- C語言從入門到精通
- 時空數據建模及其應用
- 零基礎學Scratch 3.0編程
- Android系統(tǒng)下Java編程詳解
- Building UIs with Wijmo
- Head First Kotlin程序設計
- C語言程序設計實驗指導
- HTML5 and CSS3:Building Responsive Websites