Explore layer attributes

In this lesson, you'll investigate current hiking trail data and identify opportunities to implement and apply attribute data validation to streamline data maintenance and consistency.

Review City hiking trail layer attributes

First, you'll review line features representing hiking trails around Vienna, Austria. You'll investigate the current attribute values and consider how the use of GIS and attribute validation can support data integrity and improve organizational efficiency for users of the hiking trail data available from the City of Vienna.

  1. Open the Vienna City Map Hiking Trails map.

    This page contains the city's current hiking trail map. The trails are displayed as green lines.

    Note:

    Trails may not be displayed on the map by default. To turn on trails, under Show on the map, scroll to City walks and check the City hiking trail layer.

  2. On the map, click a hiking trail and review the pop-up.

    Hiking trail pop-up

  3. In the pop-up, click Further information.

    A new page appears. It contains additional details about the trail you clicked.

    While the map provides a great service, it would be even more useful if the additional details were available as attributes for each hiking trail. That way, the information could be displayed in the trail's pop-up, which would eliminate the need to navigate to a new page. Furthermore, when new trails are created, it will be a more streamlined process to populate trail attributes because geodatabase attribute validation techniques will be applied.

  4. Go to the Vienna item on ArcGIS Online. This project package contains the data used in the Apply Subtypes and Domains to Vienna Hiking Trails lesson.
  5. Click Open in ArcGIS Pro.

    Vienna project and data

    The content is downloaded as a package called item.pitemx.

  6. Open item.pitemx. If necessary, in ArcGIS Pro, sign in using your licensed ArcGIS account.
    Note:

    If you don't have ArcGIS Pro or an ArcGIS account, you can sign up for an ArcGIS free trial.

    Note:

    If you prefer, you can download and open the project package separately. To do so, click Download. Locate the downloaded Vienna.ppkx on your computer. If necessary, copy and move the file to a suitable location, then double-click it to open the package in ArcGIS Pro.

  7. In the Catalog pane, expand the Databases folder and expand vienna.gdb.
  8. Right-click ViennaCityTrails_Raw and choose Add To Current Map.

    Add To Current Map option

    The Vienna City Trails features are displayed with default symbology.

    Vienna City Trails layer

  9. In the Contents pane, uncheck the Vienna City Trails layer to turn it off.
  10. In the Catalog pane, under vienna.gdb, drag RundumadumTrail_Subtypes onto the map. If necessary, in the Contents pane, turn on the Rundumadum Trail Stages layer.

    This layer is already symbolized with a different color for each trail stage. When a layer contains subtypes, ArcGIS Pro automatically applies Unique Values symbology to the attribute with subtypes.

    Rundumadum Trail Stages layer

    The Rundumadum Trail Stages layer has a subtype applied to its TrailStage field. Subtypes allow you to categorize or group features within a feature class and offer editors a predefined list of valid attribute choices. A feature class can have a subtype applied to only one of its attribute fields.

  11. In the Contents pane, right-click the Rundumadum Trail Stages layer and choose Attribute Table.

    The layer's attribute table opens. Attribute tables form the foundation of geographic data and are the fundamental building blocks of any data model. Attribute information in a table is organized into rows and columns. In ArcGIS, rows are known as records, and columns are referred to as fields.

  12. If necessary, drag and dock the Rundumadum Trail Stages attribute table below the map.

    The highlighted field, Trail Stage Number, represents the field to which the subtype has been applied. The field displays a description containing the trail stage name.

    Trail Stage Number attribute

    Note:

    Another way to display a layer's attribute table is to select the layer in the Contents pane. On the ribbon, click the Data tab. In the Table group, click Attribute Table. In addition, the Design group contains buttons for Fields, Subtypes, and Domains. These are tools for working with a data model and updating and modifying the geodatabase schema.

    Behind the scenes, the geodatabase stores integer values instead of descriptive names in the subtype field. The integers are paired to the descriptions via a lookup table, which results in smaller file sizes and greater efficiency.

  13. In the attribute table, click the options button and choose Show domain and subtype descriptions to switch between the subtype code and the description.

    Show domain and subtype descriptions option

    The table updates to show the subtype codes instead of the descriptions.

    Subtype codes

  14. Click the options button and choose Show domain and subtype descriptions to display the subtype descriptions.
  15. With the table selected, on the ribbon, click the View tab. In the Field group, click Aliases.

    Aliases button

    The field names switch from displaying field aliases with descriptive names to displaying the original field names.

    Aliases and field names

    Aliases are a useful way to provide users with descriptive field names without compromising database field name rules that restrict the length and the use of spaces and special characters.

  16. On the ribbon, on the Table tab, in the Field group, click Aliases to switch back to aliases.
  17. If necessary, in the Contents pane, click the Rundumadum Trail Stages layer to select it.
  18. On the ribbon, click the Data tab. In the Design group, click Fields.

    Fields button

    The Fields view opens. It displays a layer's attribute fields and properties. From the Fields view, you can create fields, delete fields, and modify existing fields.

    The TrailStage field name is bold and preceded by an asterisk to denote that it has a subtype applied. The field's data type is set to Short, which means short integer. Fields with a subtype must be a short or long integer field. The field has an alias of Trail Stage Number.

    TrailStage field

    One of the fields is called BEZ_TEXT. Because the field name is not descriptive, the alias Original Name was set for this field.

    Review field properties

  19. For BEZ_TEXT, double-click the cell containing the alias Original Name.

    The cell is highlighted, indicating that you can optionally update or change the current alias. You will not make a change at this time.

  20. For BEZ_TEXT, deselect the Alias cell by clicking elsewhere in the table.

    The Data Type column contains the data type for each field. In this table, fields are primarily set to Text, Float, and Short. Internal fields are set to Double. Trail locations (coordinates) are stored in a special field type called Geometry.

    Review attribute field types

    Each field in a table stores a specific type of data as shown in the following table:

    Field typeDescription

    Text

    String of characters

    Float

    Decimal numbers between -3.4E38 and 1.2E38

    Double

    Decimal numbers between -2.2E308 and 1.8E308

    Short

    Whole numbers between -32,768 and 32,767

    Long

    Whole numbers between -2,147,483,648 and 2,147,483,647

    Date

    Date or time or both date and time

    Blob

    A collection of binary data such as images, audio, and other multimedia

    Raster

    Raster images

    GUID

    Globally unique identifier

    Geometry

    Stores x,, coordinate pairs representing spatial features

  21. Close the Fields view and Rundumadum Trail Stages attribute table. In the Contents pane, uncheck the Rundumadum Trail Stages layer.
  22. Save the project.

Add a new field

Next, you'll add and populate a new short integer field that will be used to create a subtype for the Vienna City Trails layer.

  1. In the Contents pane, turn on the Vienna City Trails layer. Right-click the layer, point to Design, and choose Fields.

    The Fields view for the Vienna City Trails layer appears.

  2. If necessary, position and dock the pane.
  3. Scroll to the bottom of the Fields view. Click Click here to add a new field.
    Tip:

    New fields can also be added from the ribbon on the Fields tab in the Changes group.

    Click here to add a new field option

    Note:

    As edits are made in the Fields view, a green indicator appears next to edited rows. A red indicator next to a row indicates an error that will prevent that row from being committed when Save is clicked. To read the error, point to the red indicator. When you correct the error, the indicator turns green again.

  4. In the new row, click the empty cell in the Field Name column. Type TrailRating.
  5. Click the empty cell for Alias and type Trail Rating.
  6. For Data Type, choose Short.
  7. Check the Highlight box.

    Field properties

    Note:

    When you save changes made while working in the Fields view, you are updating the geodatabase structure, also known as the geodatabase schema. This is different than editing features in a feature class or attribute table, where you are only changing content.

    The Number Format property allows you to change the display of numeric values. This is useful if you want to limit the number of decimal places shown, or express numbers as a percent. However, this won't be necessary for your new Trail Rating field. Even though it will store numeric values, it will not display them as numbers. The integer values will be substituted with subtype descriptions instead.

  8. On the ribbon, on the Fields tab, in the Changes group, click Save.

    Save button

  9. Close the Fields view.
  10. In the Contents pane, right-click the Vienna City Trails layer and choose Attribute Table.

    The Trail Rating field has been added to the end of the attribute table.

    New field added to attribute table

    Next, you'll update and edit the Trail Rating field values that will serve as the subtypes for the Vienna City Trails layer.

  11. In the attribute table, right-click the Estimated Time field and choose Sort Ascending.

    Sort Ascending option

    For the trails, the rating is based on the estimated time to complete the trail. For example, trails that can be completed in 2.5 to 3 hours are rated as easy.

    Note:

    You may want to move the Estimated Time field closer to the Trail Rating field. To do this, select the field and drag it to a new position.

  12. For the Trail Rating field, double-click the first cell, type 1, and press Enter.

    Added field value

  13. In the second cell, type 1 and press Enter.
  14. On the ribbon, on the Edit tab, in the Manage Edits group, click Save.

    Save button

  15. In the Save Edits window, click Yes.
  16. In the attribute table, continue updating the Trail Rating field values using the following table:

    Estimated TimeTrail Rating

    2.5 to 3 hours

    1

    3 to 4 hours

    2

    3.5 to 4 hours

    2

    4 to 4.5 hours

    3

    4 to 5 hours

    3

  17. In the Vienna City Trails attribute table, verify that you successfully updated all Trail Rating field values.

    Field values verified

  18. On the ribbon, on the Edit tab, in the Manage Edits group, click Save. In the Save Edits window, click Yes.
  19. Save the project.

You successfully added and populated the field in preparation for applying a subtype based on trail rating. Next, you'll add the subtype descriptions and review the results.


Create and explore subtypes

In this lesson, you'll create a subtype on a field and update codes and descriptions.

Use the subtypes view

Subtypes allow you to categorize a layer into groups of features that share the same attribute. Using the Subtypes view, you can review the subtypes associated with layers, make edits to the properties of the subtypes, or create subtypes for a layer.

The current Vienna City Trails layer does not have any subtypes defined. You'll create a subtype for the Trail Rating field you added and populated.

  1. If necessary, open your project. In the Contents pane, click the Vienna City Trails layer to select it.
  2. On the ribbon, click the Data tab. In the Design group, click Subtypes.

    Subtypes button

    The Subtypes view opens. It lists all of the layer's fields in a table.

  3. Resize the Subtypes view to display the TrailRating field.
  4. On the ribbon, in the Subtypes tab, in the Subtypes group, click Create/Manage.

    Create/Manage button

    The Manage Subtypes pane appears.

  5. In the Manage Subtypes pane, for Subtype Field, choose TrailRating.

    TrailRating option

    You could add a trail rating code and a description for each subtype you need to generate. An easier way to populate the subtype codes is to allow the tool to discover each unique code in the specified subtype field. This is useful if you have many subtypes to create.

  6. In the Manage Subtypes pane, click Discover codes.

    The Manage Subtypes pane updates to display three subtype codes. These represent the Trail Rating field values you assigned to the various trails based on the Estimated Time field.

    Manage Subtypes pane

    Next, you'll sort the codes and provide a description for each subtype.

  7. Click Code to sort the subtype codes in ascending order.

    Code option

    You'll add a subtype for new trails that do not yet have a trail rating assigned.

  8. Click the empty cell below 3, type 4, and press Enter.

    New subtype code added

    Next, you'll provide a description for each subtype.

  9. Under Description, delete New Subtype1, type Easy, and press Enter.
  10. Provide a description for each additional subtype, using the following table:

    Trail ratingSubtype code

    1

    Easy

    2

    Moderate

    3

    Strenuous

    4

    Unrated

  11. For Default Subtype, choose Unrated.

    Unrated option

  12. Click OK.

    The subtype is created and assigned. The Manage Subtypes pane closes.

  13. On the ribbon, on the Subtypes tab, in the Changes group, click Save.
  14. In the Subtypes view, in the Field Name column, confirm that TrailRating is identified as the subtype field.
    Tip:

    The TrailRating subtype field name is bold and preceded by an asterisk. In addition, each subtype has the default value set to the subtype code.

    Columns for default values and domains are added to each subtype.

    Subtype categories and codes

  15. Close the Subtypes view.

    In the attribute table, the Trail Rating field updates to display the subtype descriptions, rather than the numeric values.

    Subtype descriptions displayed

  16. Close the attribute table.

    Next, you'll symbolize the trails layer using the subtype field.

  17. In the Contents pane, right-click the Vienna City Trails layer and choose Symbology.
  18. In the Symbology pane, for Primary symbology, choose Unique Values. For Field 1, choose Trail Rating.

    Update layer symbology

  19. In the Classes grid, right-click the line symbol associated with Easy trails. In the color picker, choose Quetzel Green.

    Change symbol color

    The easy trails on the map are now green.

  20. Change the colors of the other symbols as follows:

    • For Moderate, choose Electron Gold.
    • For Strenuous, choose Mars Red.
    • For Unrated, choose Moorea Blue.

    There is an additional symbol class that you do not need to show. Because you've already created a subtype for unrated trails, you can remove the all other values symbol class.

    Layer symbology

  21. Click More and uncheck Show all other values.

    Show all other values option

    Your map is now symbolized to more intuitively reflect trail ratings.

    Map symbolized

  22. Save the project.

Use a subtype

You successfully updated the Vienna City Trails feature class by applying a subtype field on the city trails. Subtypes not only enforce integrity by allowing you to choose from a list of valid values, they also allow you to categorize your data. You can set default values on fields in each of the subtypes that will automatically apply when you create features.

Next, you'll add domains to a geodatabase, and apply them to individual fields of existing feature classes.

  1. In the Contents pane, click the Vienna City Trails layer to select it.
  2. On the ribbon, click the Edit tab. In the Selection group, click Select.
  3. On the map, click any of the features in the Vienna City Trail layer.

    Select button

  4. On the Edit tab, in the Selections group, click Attributes.

    The Attributes pane appears, allowing you to start editing the attribute field values for the selected trail.

    Attributes pane

  5. In the Attributes pane, click the Trail Length field.

    The field is highlighted, indicating that you can update its value by typing a new value. Currently, you can update the Trail Length field value with any value. There is no mechanism to verify or limit what values are added. You will address this problem later.

    Trail Length value

    You will not make a change to the Trail Length field value at this time.

  6. Scroll to the bottom of the Attributes pane and locate the Trail Rating field. Click the menu to the right of this field.

    A list of descriptions appears, allowing you to optionally update the current subtype.

    Apply a different subtype

    You cannot type a custom Trail Rating value. Instead, you must select one of the valid values from the list, maintaining data consistency. This functionality is a major reason for using subtypes.

    You will not change the Trail Rating field value at this time.

  7. Close the Attributes pane.
  8. On the Edit tab, in the Selection group, click Clear.
  9. Save the project.

You successfully updated the Vienna City Trails feature class in the geodatabase by applying a subtype field to the city trails.


Create and explore domains

Next, you'll add domains to a geodatabase and apply them to individual fields of existing feature classes.

Review coded value and range domains

Domains are similar to subtypes in that they enforce data integrity by offering a list of valid values to choose from while populating attribute fields. Unlike subtypes, however, domains are used to regulate the values permitted in any particular attribute field for a table, feature class, or subtype. Domains are stored in a geodatabase and can be applied to multiple feature classes and tables within the geodatabase. Depending on your requirements, attribute domains are applied either as range domains or coded value domains. Range domains define a field's minimum and maximum values. They can be used in short, long, float, double, and date attribute fields. Coded value domains specify a valid set of values for an attribute, giving both the allowed actual value and a more easily interpreted description of what the code represents.

  1. If necessary, open your project. In the Contents pane, select Vienna City Trails.
  2. On the ribbon, click the Data tab. In the Design group, click Domains.

    Domains button

    In the Domains view, you can review existing domains, edit their properties and values, and create domains.

    Domains view

    Next, you'll create a domain.

  3. In the Domains view, double-click the empty cell for Domain Name and type Accessibility. For Description, type Trail accessibility.
  4. For Field Type, choose Short. For Domain Type, confirm that Coded Value Domain is selected.

    When the domain type is a coded value domain, an additional table (to the right) is used to input domain codes and descriptions.

    New domain

  5. In the Code/Description table, for Code, type 1. For Description, type Unpaved.
  6. In the Code/Description table, add Code and Description values using the following table:

    CodeDescription

    1

    Unpaved

    2

    Paved

    3

    Partially Paved

    4

    Stroller Friendly

    5

    Wheelchair Friendly

  7. Confirm that the Code/Description table now has five codes and descriptions.

    Five codes and descriptions

  8. On the ribbon, on the Domains tab, in the Changes group, click Save.

    Save button

  9. On the ribbon, on the Domains tab, in the Changes group, click New Domain.
  10. For Domain Name, type MaxTrailDuration. For Description type Maximum Trail Duration.
  11. For Field Type, choose Short.
  12. For Domain Type, choose Range Domain.

    Range Domain option

    When a range domain is selected, the additional table provides for the input of minimum and maximum values to limit or constrain the numerical values that can be used in the field.

  13. In the Minimum/Maximum table , for Minimum, type 3.
  14. In the Minimum/Maximum table, for Maximum, type 7.

    Minimum and Maximum values

  15. On the ribbon, on the Domains tab, in the Changes group, click Save.
  16. In the Domains view, create a range domain for minimum trail duration using the following parameters:

    Domain NameDescriptionField TypeMinimum ValueMaximum Value

    MinTrailDuration

    Minimum Trail Duration

    Short

    1

    2

  17. On the ribbon, on the Domains tab, in the Changes group, click Save.
  18. Confirm that the Domains view is updated and contains three domains.

    Three new geodatabase domains

  19. Add three more range domains using the following parameters:

    Domain NameDescriptionField TypeMinimum ValueMaximum Value

    ShortTrailLength

    Average kilometer length of a short trail

    Short

    2

    9

    MediumTrailLength

    Average kilometer length of a medium trail

    Short

    10

    13

    LongTrailLength

    Average kilometer length of a long trail

    Short

    14

    15

    Additional range domains

    A total of six domains have been added.

  20. On the ribbon, on the Domains tab, in the Changes group, click Save. Close the Domains view.

    Creating coded value domains with many codes and descriptions can be a time consuming and laborious process. To speed up the process, you'll use a geoprocessing tool to create additional coded value domains from existing tables in the geodatabase.

Create domains using geoprocessing tools

The Table To Domain geoprocessing tool is used to create or update a coded value domain with values from a table. Next, you'll use this tool to create multiple coded value domains in the geodatabase.

Note:

Attribute domains are a property of the geodatabase and can be shared across feature classes, tables, and subtypes in a geodatabase. They provide an effective way of enforcing data integrity by limiting what can be inserted into a field using the codes in a coded value domain or the minimum or maximum range in a range domain.

  1. In the Catalog pane, expand the Maps folder, right-click ReferenceMap, and choose Open.
  2. In the Contents pane, right-click the Duration table and choose Open.

    Open option

    The table contains values that can be used in a Trail Duration domain.

    Duration table content

    Next, you'll use a geoprocessing tool to create a domain and assign values to it from this table.

  3. Close the Duration table and the ReferenceMap map.
  4. On the ribbon, on the Analysis tab, click Tools.
  5. In the Geoprocessing pane, search for and select Table To Domain.
  6. In the Table To Domain tool, update the following parameters:

    • For Input Table, browse to Vienna.gdb, and choose Duration.
    • For Code Field, choose TrailDuration.
    • For Description Field, choose TrailDurationTimes.
    • For Input Workspace, browse to and choose Vienna.gdb.
    • For Domain Name, accept the default name TrailDuration.
    • For Domain Description, type Time needed to complete trail.

    Table To Domain geoprocessing tool parameters

  7. Click Run.
  8. On the ribbon, click the Data tab. In the Design group, click Domains.

    The Domains view appears. The TrailDuration domain has been successfully added.

    Table To Domain output

    Note:

    When adding domains using geoprocessing tools, the view may not automatically refresh to reflect updated domains in the geodatabase. You may need to save your project, restart ArcGIS Pro, and open the Domains view.

  9. Using the Table To Domain geoprocessing tool, create four additional coded value domains based on the parameters below.
    Note:

    All of the input tables are located in Vienna.gdb.

    Input TableCode FieldDescription FieldInput WorkspaceDomain NameDomain Description

    Scenery

    SceneryCode

    SceneryDescription

    Vienna.gdb

    Scenery

    Various types of scenery along trail

    TrailLength

    LengthCode

    LengthDescription

    Vienna.gdb

    TrailLength

    Trail distance in kilometers

    ElevationChange

    ElevationCode

    ElevationDescription

    Vienna.gdb

    ElevationChange

    Rate of change in elevation along trail

    TrailType

    TrailTypeCode

    TrailTypeDescription

    Vienna.gdb

    TrailType

    Description of trial types

  10. Close the Domains view and save the project.
  11. Close and restart ArcGIS Pro.
  12. Under Recent Projects, choose Vienna.
  13. In the Contents pane, click Vienna City Trails.
  14. On the ribbon, click the Data tab. In the Design group, click Domains.
  15. In the Domains view, confirm that the Scenery, TrailLength, ElevationChange, and TrailType domains have been successfully added.
    Tip:

    If the new domain does not appear, close and reopen the Domains view.

    New geodatabase domains

  16. Close the Domains view and save the project.

Assign domains to fields

If the features in a table have been grouped into subtypes, different attribute domains can be assigned to each of the subtypes. However, when a domain is associated with an attribute field, only the values within that domain are valid for the field; the field will not accept a value that is not in that domain.

  1. In the Contents pane, right-click the Vienna City Trails layer and choose Attribute table.

    The Trail Accessibility and Average Trail Elevation fields are populated with nondescriptive values that are not very useful.

    Candidate fields for domains

    Next, you'll assign domains to these fields and review how domains affect the table.

  2. On the ribbon, on the Data tab, in the Design group, click Subtypes.
  3. If necessary, expand the Subtypes view so you can see the entire table without scrolling.
  4. For the Easy subtype, locate the Accessibility field and double-click the domain cell. Choose and assign the Accessibility domain.

    Accessibility domain

  5. For the Moderate, Strenuous, and Unrated subtypes, assign the Accessibility domain to the Accessibility field.
  6. On the ribbon, on the Subtypes tab, in the Changes group, click Save.
  7. In the Subtypes view, confirm that you successfully assigned the Accessibility domain to each subtype for the Accessibility attribute field.

    Domain assignment

    Note:

    A benefit of applying a subtype to a field in a table is that you can apply different domains for each subtype for the same attribute field.

  8. In the Length field, in the Easy column, set Domain to ShortTrailLength.

    ShortTrailLength domain

  9. In the Length field, in the Moderate column, set Domain to MediumTrailLength.
  10. In the Length field, in the Strenuous column, set Domain to LongTrailLength.
  11. In the Length field, in the Unrated column, set Domain to ShortTrailLength.

    Different domains assigned per subtype

  12. On the ribbon, on the Subtypes tab, in the Changes group, click Save.
  13. For the Easy, Moderate, Strenuous, and Unrated subtypes, assign the following additional domains:

    Field NameDomain

    MinDuration

    MinTrailDuration

    MaxDuration

    MaxTrailDuration

    Scenery

    Scenery

    Elevation

    ElevationChange

    TrailType

    TrailType

  14. On the ribbon, on the Subtypes tab, in the Changes group, click Save.
  15. In the Subtypes view, confirm that you successfully assigned the correct domain to each subtype.

    All domain assignments

  16. Close the Subtypes view.
  17. If necessary, open the attribute table for the Vienna City Trails layer.

    The Trail Accessibility, Average Trail Elevation, and Highlighted Scenery fields are now populated with descriptive values derived from the domain descriptions.

    Explore domains assigned to fields

    The Types of trail field remains empty, as no values have been entered into to this field. This field does have a domain applied, but without values added and with no default set, the domain cannot be validated.

  18. Close the attribute table and save the project.

You've added domains and applied them to fields of a feature class. Next, you'll edit trail features using domains and subtypes.


Edit with domains and subtypes

Next, you'll update a trail feature and explore the effect of domains while editing.

Update a trail feature

Using domains helps ensure data integrity by limiting the choice of values for a particular field. Validation for coded value domains is accomplished by restricting field values found in drop-down lists. Range domains are automatically validated during editing. You'll update a trail feature and use a code value and range domain.

  1. If necessary, open your project.
  2. In the Source map, in the Contents pane, click the Vienna City Trails layer to select it.
  3. On the ribbon, click the Edit tab. In the Selections group, click Select.
  4. On the map, click any trail feature to select it.
  5. On the Edit tab, in the Selections group, click Attributes.

    Attributes pane

    The Attributes pane appears. This pane allows you to edit the field values for the selected trail. This time, the values you can enter and the choices you can apply to fields are affected by the domains applied to the fields.

  6. In the Attributes pane, click the Type of trail value.

    Type of trail options

    You cannot type your own trail type. Instead, you must choose one of the predefined types.

  7. For Type of trail, choose Walking trails.
  8. Experiment with changing the values for Trail Accessibility and Highlighted Scenery.

    You may recall that you assigned a range domain to the Trail Length field that restricts length based on the different subtypes as shown in the following table:

    SubtypeDomain NameMinimum ValueMaximum Value

    Easy

    ShortTrailLength

    2

    9

    Moderate

    MediumTrailLength

    10

    13

    Strenuous

    LongTrailLength

    14

    15

  9. In the Attributes pane, for Trail Length, type 99 and press Enter.

    Trail Length value updated

    The field is highlighted in red, indicating that the trail length is not within the range allowed for a moderate trail rating subtype. In addition, the Attributes pane displays a warning that the medium trail length allowed must be between 10 and 13.

  10. Update the Trail Length value to 11 and press Enter.

    Now the value falls within the allowable range, and the warning message no longer appears.

  11. Click Apply.

    Your current changes are not committed back to the geodatabase until you save your edits.

  12. Close the Attributes pane.
  13. On the Edit tab, in the Manage Edits group, click Save.
  14. In the Save Edits window, click Yes to confirm and commit your updates to the geodatabase.
  15. Clear the selection.
  16. On the ribbon, click the Map tab. In the Navigate group, click the Explore button.
  17. Save the project.

You edited a feature with domains and subtypes. Next, you'll publish and use your feature service.


Publish and use a feature service

Next, you'll publish the Vienna City Trails layer and verify access to data validation while editing in a web map.

Publish and update features with subtypes and domains

To publish and update features that support subtypes and domains in a web app, you must ensure that all editable layers have a feature template configured. A feature template is a predefined collection of construction tools that is used to create features on the layer.

Feature templates are a property of a layer and are managed and maintained in the ArcGIS Pro project. If the layer is shared as a layer file, layer package, or web layer, the template properties are also shared. You'll create a feature template for the Vienna City Trails layer before publishing the layer.

  1. If necessary, open your project.
  2. On the Edit tab, click the Manage Templates button in the lower right corner of the Features group.

    Click manage templates button

  3. In the Manage Templates pane, under the Source map, click the Vienna City Trails layer.

    Vienna City Trails layer

  4. Right-click the Vienna City Trails layer and choose Create all templates. This action will generate and add feature templates to the templates box for each associated layer subtype.

    Create all templates option

    Each template is named to match the subtype description and you can set different default values and apply different edit strategies and edit tools to be used to update or create features using the templates.

  5. In the Templates box, review the templates, then click and select Easy and click Properties.

    Properties button

  6. In the Template Properties: Easy pane, update the following parameters:

    • For Name, type Easy Trail.
    • For Description, type Create and update easy trails.

    Name and Description parameters

  7. Click OK.
  8. Sign in using your licensed ArcGIS Online account.
  9. In the Source map, in the Contents pane, remove all layers except the Vienna City Trails layer.
  10. Save the project.
  11. On the ribbon, on the Share tab, in the Share As group, click Web Layer and choose Publish Web Layer.

    Publish Web Layer option

  12. In the Share As Web Layer pane, update the following parameters:
    • For Name, type Vienna City Trails followed by your initials.
    • For Summary, type Hiking trail data with attribute validation applied.
    • For Tags, confirm that the following map tags were added: Vienna, Austria, Visitor map, Tourism, Activities, Trails, Hiking, Bike Routes, Paths, Parks, Natural areas, views, bird watching, walking, wild flowers, hiking, forest, nature trips, wildlife, river, trail running, mountain biking.
    • For Layer Type, choose Feature.
    • For Location, choose Create new folder and type Vienna Trails.
    • For Share with, choose Everyone.

    Web layer properties

  13. In the Share As Web Layer pane, click Analyze and confirm that no errors or warnings are found.
  14. Click Publish.
    Note:

    Publishing may take a few minutes to complete.

  15. At the bottom of the Share As Web Layer pane, click Manage the web layer.

    A browser opens to the item details page of your Vienna City Trails web layer.

Edit features in a web map

Next, you'll enable editing and verify that data validation occurs while editing in the web map.

  1. If necessary, click Sign In and sign in to your ArcGIS organizational account.
  2. Click Settings.

    Settings button

  3. Locate the Feature Layer (hosted) settings.
  4. Under Editing, check Enable editing and confirm that What kind of editing is allowed is set to Add, update, and delete features.

    Feature layer editing enabled

  5. Click Save.
  6. On the ribbon, click Overview.
  7. Click the Open in Map Viewer drop-down arrow and choose Add to new map with full editing control.

    Add to new map with full editing control option

  8. In the Vienna City Trails web map, click Basemap.
  9. In the Basemap pane, choose Dark Gray Canvas.
  10. Click Edit.

    Edit button

  11. In the map, click and select a trail.
  12. In the pop-up, click the Type of trail value.

    Type of trail value

    The web layer honors the subtype and domains that have been applied to the source layer, ensuring that new trails collected and edits made to trails in a web map or app will remain valid.

  13. For Type of trail, choose Hiking trail.
  14. Click Trail Length, type 99, press Enter.

    The value is out of range warning

    A warning informs you that the value you entered is out of the minimum and maximum range as defined for this field. Some other fields have warnings as well. These are a result of changes made before the domain was applied to the field, and the value stored is now out of range.

  15. For Trail Length, type 10 and press Enter.
    Note:

    The edits you make to the feature layer in Map Viewer are automatically saved to the layer. When you add, delete, or edit a feature or attribute and realize you made a mistake, you can click Undo to delete your edit.

  16. In the Attributes pane, click Close to save your edits.
  17. In the Contents pane, click Moderate Trail to add a new feature.

    Moderate Trail option

  18. In the map, click to start adding vertices for a new trail feature.
  19. Continue adding vertices and double-click when you complete the new trail.

    Completed feature

  20. Click the new feature to display its vertices.

    You can select and move vertices as needed to update and change the route the trail follows.

    Feature with vertices

  21. To commit your updates, click a location on the map away from the feature you created.
  22. Click the new feature to display the Attributes pane.
  23. Update your new trail attributes by typing a name and selecting attribute values from the various lists applied to fields.

    New feature attributes updated

  24. When you're finished, click Close.
  25. Optionally save the map.

In this lesson, you investigated how a local Vienna tourist agency can use attribute validation techniques in a geodatabase to build and maintain a hiking trail layer that provides clients with trail information and offers them an opportunity to contribute and suggest new trails. Using subtypes and domains, the agency can ensure data consistency, reduce redundancy, and build efficient web maps and downloadable apps.

Subtypes and domains are powerful tools for ensuring data integrity and the efficiency of a geodatabase, and you may find them useful on many of your datasets. However, they are most useful when working with large datasets. Errors can occur in any dataset, but once your feature count exceeds a few hundred, it becomes difficult to manually sort through and ensure that you don't have any typos or other errors. If multiple people will be editing the same feature class, it increases the opportunity for errors.

Assigning domains to attribute fields creates restrictions on the allowable values, so you can't enter misspelled words or numeric values outside of a defined range. Domains help to ensure that your data remains clean and accurate. Subtypes can also apply restrictions on allowable attribute values but only on one integer field per feature class. Subtypes true usefulness is classifying your data to make it perform faster by storing information in coded integers instead of long strings.

On your own, you may want to revisit the Rundumadum Trail Stages layer and assign geodatabase domains to the various attribute fields associated with the 24 stages of the trail.

You can find more lessons in the Learn ArcGIS Lesson Gallery.