Reader small image

You're reading from  ArcGIS for Desktop Cookbook

Product typeBook
Published inJan 2015
Reading LevelBeginner
Publisher
ISBN-139781783559503
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Daniela C Docan
Daniela C Docan
author image
Daniela C Docan

Daniela Cristiana Docan is currently a lecturer at the Department of Topography and Cadastre at the Faculty of Geodesy in Bucharest, Romania. She obtained her PhD in 2009 from the Technical University of Civil Engineering, Bucharest, with her thesis Contributions to quality improvement of spatial data in GIS. Formerly, she worked at Esri Romania and National Agency for Cadastre and Land Registration (ANCPI). While working for Esri Romania, she trained teams (as an authorized instructor in ArcGIS for Desktop by Esri) from state- and privately-owned companies, such as the Romanian Aeronautical Authority, the Agency of Payments and Intervention for Agriculture (APIA), and the Institute of Hydroelectric Studies and Design. She also trained and assisted the team in charge of quality data control in the Land Parcel Identification System (LPIS) project, in Romania. For the ANCPI, she created the logical and physical data model for the Romanian National Topographic Dataset at a scale of 1:5,000 (TOPRO5) in 2009. She was a member of the workgroup that elaborated TOPRO5 and its metadata technical specifications and the Report on the implementation of the INSPIRE Directive in Romania in 2010. Prior to this book, Daniela worked on ArcGIS for Desktop Cookbook, Packt Publishing, which covers the following topics: designing a file geodatabase schema, constraining the geometry and attribute values of the data, geocoding addresses, working with routes and events, and using spatial ETL tools.
Read more about Daniela C Docan

Right arrow

Creating domains


The domains define the valid values for the attribute fields of feature classes or non-spatial tables. The domains are properties of a geodatabase, and obviously are stored at the geodatabase level. In a feature class/table, an attribute field can have one or many domains associated with it. The multiple domains associated with a field are based on the existing subtypes that you have already defined for a feature class. A domain can be associated with one or many attribute fields of one or more feature classes from a geodatabase.

There are two domain types: Range and Coded Values. A range domain defines minimum and maximum values and can be used only by the numeric and date field types. A coded domain can be used by the numeric, date, and text field types and defines an explicit list of valid values. Every valid value has a code and a description. A domain defines the attribute behavior when a feature is split or merged in ArcMap using the Split policy and the Merge policy.

Note

For more details about domains, please refer to Geodata/Data types/Domains from ArcGIS help (10.2) online.

Getting ready

Let's continue to work with geodatabase schema by defining valid values for the attribute fields of feature classes that you created in the Creating a feature class recipe. You will create the domains in the geodatabase Properties.

In the Database Properties dialog, the Domains section has three main sections:

  • Domain Name | Description: This defines domain name and description

  • Domain Properties: This sets the domain properties, such as the data type, domain type and split/merge policy

  • Coded Values: This defines the codes and descriptions

How to do it...

Follow these steps to create domains using the ArcCatalog context menu:

  1. Start ArcCatalog. In Catalog Tree, go to <drive>:\PacktPublishing\Data\MyGeodatabase\Topo5k.gdb. Right-click on the Topo5k.gdb file geodatabase, and select Properties | Domains.

  2. In the first cell from the Domain Name column, type dBM. For the Description column, type Building material. In the second section, Domain Properties, for the Field Type tab, choose Long Integer from the drop-down list. For Domain Type, select Coded Values from the drop-down list. For Split policy, select Duplicate and for Merge policy, leave Default Value. You will establish the default values later in this recipe. In the Coded Values section, add the following codes and descriptions:

    Code

    Description

    Code

    Description

    0

    Unknown

    4

    Clay

    1

    Concrete

    5

    Mixture

    2

    Brick

    6

    Metal

    3

    Wood

    100

    Other

  3. To save changes, click on Apply from time to time. You should see something similar to the following screenshot:

  4. Create a new domain named dStories with Description of Number of stories. In the Domain Properties section, for the Field Type option, choose Long Integer. For Domain Type, select Range from the drop-down list. For Minimum value, type 1, and for Maximum value, type 6. For Split policy, select Duplicate, and for Merge policy, leave Default Value.

  5. Create a new domain named dState with Description: State of building. In the Domain Properties section, for the Field Type option, choose Text. For Domain Type, select Coded Values from the drop-down list. For Split policy, select Duplicate, and for Merge policy, leave Default Value. You will establish the default values later in this recipe. In the Coded Values section, add the following code and description:

    Code

    Description

    Code

    Description

    fb

    Very good

    r

    Bad condition

    b

    Good

    i

    Insanitary

    s

    Satisfactory

    c

    Construction

  6. To save changes, click on Apply from time to time.

  7. The next domain is dHYC. For the Description column, type Hydrologic category. In the Domain Properties section, for the Field Type option, choose Long Integer. For Domain Type, select Coded Values from the drop-down list. For Split policy, select Duplicate, and for Merge policy, leave Default Value. In the Coded Values section, add the following code and description:

    Code

    Description

    Code

    Description

    0

    Unknown

    2

    Intermittent

    1

    Perennial

    3

    Ephemeral

  8. Create a last domain dUnkn. For the Description column, type Unknown Text. In the Domain Properties section, for the Field Type option, choose Text. For Domain Type, select Coded Values from the drop-down list. For Split policy, select Duplicate, and for Merge policy, leave Default Value. In the Coded Values section, you will add the code and description. For the Code column, type Unkn, and for Description, type Unknown.

  9. Click on Apply to save changes. Click on OK to close the Database Properties window.

  10. Right-click on Topo5k.gdb, and navigate to Properties | Domains to inspect the results.

How it works...

At step 2, for Split policy, you selected Duplicate. When you split a building made of Brick material (domain code: 2) during the edit session in ArcMap, you will have two buildings made from bricks. For Merge policy, you selected Default Value. Let's suppose you already established the Default Value option for the BM (Building material) field to 0. When you merge two buildings made of Brick material (domain code: 2) during the edit session in ArcMap, you will have two buildings made of Unknown material (domain code: 0). The range and coded values can be validated in the ArcMap edit session using the Validate Features option from Editor present in the Editor toolbar. The Validate Features option helps you to find mistaken attribute values in the sense that it is not a valid value.

There's more...

To create a new coded value domain for a file geodatabase, based on a table that contains the defined codes and descriptions for a domain, you can use the Table To Domain tool from ArcToolbox. In ...\Data\DesigningGeodatabase\LandUseDomains folder, you have five dBASE tables corresponding to the following domains: dArable, dPasture, dMeadow, dVineyard, and dFruitOrchard.

Follow these steps to create more domains for your file geodatabase using ArcToolbox:

  1. Select ArcToolbox from the Standard toolbar. Navigate to Data Management Tools | Domains, and double-click on the Table To Domain tool. Set the following parameters:

    • Set the Input Table parameter as ... \Data\DesigningGeodatabase\ LandUseDomains\Arable.dbf

    • Set the Code Field option as CodeArable

    • Set the Description Field option as Descript

    • Set the Input Workspace field as ... \Data\MyGeodatabase\Topo5k.gdb

    • Set the Domain Name field as dArable

    • Set the Domain Description (optional) field as Land Use domain from table

    • Accept default option for the Update Option (optional) field

  2. Click on OK to close the Table To Domain dialog.

  3. Open the Database Properties dialog for the Topo5k.gdb feature class to check the subtypes you just added. Repeat step 1 to add the dPasture, dMeadow, dVineyard, and dFruitOrchard domains.

See also

  • In the Using subtypes and domains together recipe, you will learn how to combine subtypes and domains for the feature classes you just created

Previous PageNext Page
You have been reading a chapter from
ArcGIS for Desktop Cookbook
Published in: Jan 2015Publisher: ISBN-13: 9781783559503
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Daniela C Docan

Daniela Cristiana Docan is currently a lecturer at the Department of Topography and Cadastre at the Faculty of Geodesy in Bucharest, Romania. She obtained her PhD in 2009 from the Technical University of Civil Engineering, Bucharest, with her thesis Contributions to quality improvement of spatial data in GIS. Formerly, she worked at Esri Romania and National Agency for Cadastre and Land Registration (ANCPI). While working for Esri Romania, she trained teams (as an authorized instructor in ArcGIS for Desktop by Esri) from state- and privately-owned companies, such as the Romanian Aeronautical Authority, the Agency of Payments and Intervention for Agriculture (APIA), and the Institute of Hydroelectric Studies and Design. She also trained and assisted the team in charge of quality data control in the Land Parcel Identification System (LPIS) project, in Romania. For the ANCPI, she created the logical and physical data model for the Romanian National Topographic Dataset at a scale of 1:5,000 (TOPRO5) in 2009. She was a member of the workgroup that elaborated TOPRO5 and its metadata technical specifications and the Report on the implementation of the INSPIRE Directive in Romania in 2010. Prior to this book, Daniela worked on ArcGIS for Desktop Cookbook, Packt Publishing, which covers the following topics: designing a file geodatabase schema, constraining the geometry and attribute values of the data, geocoding addresses, working with routes and events, and using spatial ETL tools.
Read more about Daniela C Docan