Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ArcGIS for Desktop Cookbook

You're reading from   ArcGIS for Desktop Cookbook Over 60 hands-on recipes to help you become a more productive ArcGIS for Desktop user

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781783559503
Length 372 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Daniela C Docan Daniela C Docan
Author Profile Icon Daniela C Docan
Daniela C Docan
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Designing Geodatabase FREE CHAPTER 2. Editing Data 3. Working with CRS 4. Geoprocessing 5. Working with Symbology 6. Building Better Maps 7. Exporting Your Maps 8. Working with Geocoding and Linear Referencing 9. Working with Spatial Analyst 10. Working with 3D Analyst 11. Working with Data Interoperability Index

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:
    How to do it...
  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
You have been reading a chapter from
ArcGIS for Desktop Cookbook
Published in: Jan 2015
Publisher:
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.
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 $19.99/month. Cancel anytime