Explore layer attributes

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

Explore a map of hiking trails

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 City of Vienna's Vienna City 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 would be a more streamlined process to populate trail attributes because geodatabase attribute validation techniques will be applied.

  4. Close the additional details page and the page with the Vienna City Map.

Download the data

Next, you'll download a project package containing the data used in this tutorial and open the package in ArcGIS Pro. You'll add some of the data from a geodatabase to a map.

  1. Go to the Vienna item on ArcGIS Online.

    This project package contains the data used in this tutorial.

  2. Click Open in ArcGIS Pro.

    Open in ArcGIS Pro button

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

    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.

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

    If you don't have access to ArcGIS Pro or an ArcGIS organizational account, see options for software access.

    The package opens in ArcGIS Pro. It contains a map zoomed to Vienna.

  4. In the Catalog pane, expand the Databases folder and expand vienna.gdb.
    Tip:

    If the Catalog pane isn't open, click the View tab on the ribbon. In the Windows group, click Catalog Pane.

  5. Right-click ViennaCityTrails_Raw and choose Add To Current Map.

    Add To Current Map option

    Tip:

    In ArcGIS Pro, you can personalize the appearance of the user interface with either a light or a dark theme. In this tutorial, the example images use the dark theme, but you can choose the theme that you prefer. If you want to change the theme, click Project on the ribbon. Click Options. In the Options window, under Application, click General. Expand Application Theme and choose Dark. You'll need to restart ArcGIS Pro for your theme changes to take effect.

    The Vienna City Trails features are displayed with default symbology.

    Note:

    The symbology color of the layer may differ from the example image, but it does not impact the results of the analysis.

    Vienna City Trails layer

  6. In the Contents pane, uncheck the Vienna City Trails layer to turn it off.
  7. 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.

Explore the attributes

The Rundumadum Trail Stages layer is symbolized based on its attributes. To better understand the layer's attributes, you'll look at them in the layer's attribute table.

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

    Attribute Table option

    The layer's attribute table appears. 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.

  2. 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 click 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.

  3. In the attribute table, click the options button and uncheck Show domain and subtype descriptions.

    Show domain and subtype descriptions option

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

    Subtype codes

  4. Click the options button and check Show domain and subtype descriptions to display the subtype descriptions.
  5. With the table selected, on the ribbon, click the Table 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. For example, the Trail Stage Number alias becomes the TrailStage field name.

    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.

  6. On the ribbon, click Aliases to switch back to aliases.
  7. If necessary, in the Contents pane, click the Rundumadum Trail Stages layer to select it.
  8. On the ribbon, click the Data tab. In the Data Design group, click Fields.

    Fields button

    The Fields view opens. It displays a layer's attribute fields and properties. In this 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.

  9. 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 won't make a change at this time.

  10. Deselect the 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

  11. Close the Fields view and Rundumadum Trail Stages attribute table. In the Contents pane, uncheck the Rundumadum Trail Stages layer.
  12. On the Quick Access Toolbar, click the Save button.

    Save button

    The project is saved.

Add a new field

Next, you'll add 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 Data Design, and choose Fields.

    The Fields view for the layer appears.

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

    Click here to add a new field option

    Tip:

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

  4. In the new row, double-click the empty cell in the Field Name column. Type TrailRating.
    Note:

    As you make edits, 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.

  5. Double-click the empty cell for Alias and type Trail Rating.
  6. Double-click the Data Type cell and choose Short.
  7. Check the Highlight box.

    Field properties

    The Number Format property allows you to change the display of numeric values, which 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

    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.

  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

Populate the field

By default, new fields have no values. You'll edit the Trail Rating field you created to include values based on the length of time it takes to complete each trail.

  1. 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.

  2. Drag the Estimated Time field next to the Trail Rating field.
  3. For the Trail Rating field, double-click the first cell, type 1, and press Enter.

    Added field value

  4. In the second cell, type 1 and press Enter.
  5. In the Save Edits window, click Yes.
  6. 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

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

    Field values verified

  8. On the ribbon, on the Edit tab, in the Manage Edits group, click Save.

    Save button

  9. In the Save Edits window, click Yes.
  10. Close the attribute table. Save the project.

You've 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 subtypes

Next, you'll create a subtype on a field and update codes and descriptions.

Create subtypes for trail ratings

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. In the Contents pane, click the Vienna City Trails layer to select it.
  2. On the ribbon, click the Data tab. In the Data Design group, click Subtypes.

    Subtypes button

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

  3. If necessary, 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 window appears.

  5. In the Manage Subtypes window, 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 window, 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. Double-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, double-click 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 window closes.

  13. On the ribbon, on the Subtypes tab, in the Changes group, click Save.

    In the Subtypes view, TrailRating is identified as the subtype field due to it being 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

  14. Close the Subtypes view. In the Contents pane, right-click Vienna City Trails and choose Attribute Table.

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

    Subtype descriptions displayed

  15. Close the attribute table.

Symbolize the trails

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

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

    The Symbology pane appears.

  2. In the Symbology pane, for Primary symbology, choose Unique Values. For Field 1, choose Trail Rating.

    Update layer symbology

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

    Point to a color to see its name.

    Change symbol color

    Tip:

    In the color picker, you can see the name of a color by pointing to it.

    The easy trails on the map are now green.

  4. Change the colors of the other symbols as follows:
    • For Moderate, choose Electron Gold (fourth column, third row of the color picker).
    • For Strenuous, choose Mars Red (second column, third row of the color picker).
    • For Unrated, choose Moorea Blue (ninth column, fourth row of the color picker).

    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.

  5. 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

  6. Close the Symbology pane. 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 the Select button.

    Select button

  3. On the map, click any trail feature.

    The trail you click is selected, causing it to be highlighted blue.

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

    Attributes pane

    The Attributes pane appears. In this pane, you can edit the attribute field values for the selected trail.

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

    Trail Length value

    The field highlights, 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.

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

  6. Scroll to the bottom of the Attributes pane. For the Trail Rating field, click the Choose Symbol Class button.

    Apply a different subtype

    A list of descriptions appears, allowing you update the current 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 won't 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've successfully updated the Vienna City Trails feature class in the geodatabase by applying a subtype field to the city trails.


Create domains

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

Create domains using a view

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. In the Contents pane, select Vienna City Trails.
  2. On the ribbon, click the Data tab. In the Data Design group, click Domains.

    Domains button

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

    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.

    New domain

    When the domain type is a coded value domain, an additional table at the end of the row is used to input domain codes and descriptions.

  5. For Code, type 1. For Description, type Unpaved and press Enter.

    Unpaved record in Description field

    Once you add one code and description, another row is added.

  6. Add Code and Description values using the following table:

    CodeDescription

    1

    Unpaved

    2

    Paved

    3

    Partially Paved

    4

    Stroller Friendly

    5

    Wheelchair Friendly

    There are now five codes and descriptions.

    Five codes and descriptions

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

    Save button

  8. On the Domains tab, in the Changes group, click New Domain.

    A new domain is added to the view.

  9. For the new domain, enter the following information:
    • For Domain Name, type MaxTrailDuration.
    • For Description type Maximum Trail Duration.
    • For Field Type, choose Short.
    • For Domain Type, choose Range Domain.

    Second domain

    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.

  10. For Minimum, type 3. For Maximum, type 7.

    Minimum and Maximum values

  11. On the ribbon, on the Domains tab, in the Changes group, click Save.
  12. Create a range domain for minimum trail duration using the following parameters:
    • For Domain Name, type MinTrailDuration.
    • For Description, type Minimum Trail Duration.
    • For Field Type, choose Short.
    • For Domain Type, choose Range Domain.
    • For Minimum Value, type 1.
    • For Maximum Value, type 2.
  13. On the ribbon, on the Domains tab, in the Changes group, click Save.

    The Domains view now has three domains.

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

    Domain NameDescriptionField TypeDomain TypeMinimum ValueMaximum Value

    ShortTrailLength

    Average kilometer length of a short trail

    Short

    Range Domain

    2

    9

    MediumTrailLength

    Average kilometer length of a medium trail

    Short

    Range Domain

    10

    13

    LongTrailLength

    Average kilometer length of a long trail

    Short

    Range Domain

    14

    15

    You've created a total of six domains.

    Additional range domains

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

Create domains using a tool

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.

The Table To Domain geoprocessing tool is used to create or update a coded value domain with values from a table.

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.

    A map view appears. This map contains several standalone tables.

  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, in the Geoprocessing group, click Tools.

    Tools button

    The Geoprocessing pane appears.

  5. In the Geoprocessing pane, search for and open the Table To Domain tool.
  6. In the Table To Domain pane, set the following parameters:
    • For Input Table, choose Duration.
    • For Code Field, choose TrailDuration.
    • For Description Field, choose TrailDurationTimes.
    • For Input Workspace, browse to the project's Databases folder 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.

    The tool runs. When it finishes, no changes are made to the map. You can confirm that the tool ran successfully by checking the Domains view.

  8. In the Contents pane, select Vienna City Trails. On the ribbon, click the Data tab. In the Data Design group, click Domains.

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

    Table To Domain output

    Note:

    If you do not see the TrailDuration domain, try closing the Domains view and reopening it.

  9. Using the Table To Domain geoprocessing tool, create four additional coded value domains using the parameters in the following table:

    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 trail types

  10. Close and reopen the Domains view.

    The Scenery, TrailLength, ElevationChange, and TrailType domains have been successfully added.

    New geodatabase domains

  11. 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 non-descriptive values that are not very useful.

    Candidate fields for domains

    You'll assign domains to these fields and review how domains affect the table.

  2. On the ribbon, on the Data tab, in the Data 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. Double-click the Domain cell and choose Accessibility.

    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.

    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.

  7. For the Length field, set the following domains:
    • For the Easy subtype, set Domain to ShortTrailLength.
    • For the Moderate subtype, set Domain to MediumTrailLength.
    • For the Strenuous subtype, set Domain to LongTrailLength.
    • For the Unrated subtype, set Domain to ShortTrailLength.

    Different domains assigned per subtype

  8. On the ribbon, on the Subtypes tab, in the Changes group, click Save.
  9. 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

    All domain assignments

  10. On the ribbon, on the Subtypes tab, in the Changes group, click Save.
  11. Close the Subtypes view.
  12. If necessary, open the attribute table for the Vienna City Trails layer.

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

    Explore domains assigned to fields

    The Type 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.

  13. Close the attribute table and save the project.

Update a trail feature

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

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. Click the Source tab to return to the original map view.

    Source tab

  2. 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 the Select button.
  4. On the map, click any trail feature to select it.
  5. On the Edit tab, in the Selections group, click Attributes.

    The Attributes pane appears. You used this pane previously in the tutorial to edit field values for a 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 any type that is different from the original trail type.
  8. Experiment with changing the values for Trail Accessibility and Highlighted Scenery.

    Previously, 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.

    The field highlights 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.

    Trail Length value updated

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

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

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

  11. Close the Attributes pane.

    A message appears, informing you that there are uncommitted attribute edits. You only made changes to experiment with editing, so you'll discard the changes.

  12. Click Discard.
  13. Clear the selection.
  14. On the ribbon, click the Map tab. In the Navigate group, click the Explore button to deactivate the Select tool.
  15. Save the project.

You've added domains and applied them to fields of a feature class. You also edited a feature with domains and subtypes. Next, you'll publish and use your feature service.


Publish a feature service

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

Share a web layer

Before you can share 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 feature templates for the Vienna City Trails layer before publishing the layer.

  1. On the Edit tab, click the Manage Templates button in the lower corner of the Features group.

    Manage Templates button

  2. In the Manage Templates pane, right-click the Vienna City Trails layer and click Create all templates.

    Create all templates option

    Feature templates are generated and added to the templates box for each associated layer subtype. Each template is named to match the subtype description. 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.

    You're ready to publish the layer. First, you'll remove the other layers from the map and save the project.

  3. In the Contents pane, remove all layers (even the basemap layers) except the Vienna City Trails layer.
    Tip:

    Remove a layer by right-clicking the layer and choosing Remove.

  4. Save the project.
  5. On the ribbon, click the Share tab. In the Share As group, click the Web Layer drop-down menu and choose Publish Web Layer.

    Publish Web Layer option

    The Share As Web Layer pane appears.

  6. In the Share As Web Layer pane, update the following parameters:
    • For Name, type Vienna City Trails followed by your name or initials.
    • For Summary, type Hiking trail data with attribute validation applied.
    • For Tags, keep the default list of tags.
    • For Layer Type, confirm that Feature is selected.

    Sharing Source As A Web Layer parameters

    Note:

    If you're an ArcGIS Enterprise user, under Data and Layer Type, for Copy all data, choose Feature.

  7. For Location, type Vienna Trails. For Share with, check the box for Everyone.

    Sharing Source As A Web Layer parameters

    Before you publish, you'll analyze the layer for any errors that would prevent publishing.

  8. In the Share As Web Layer pane, click Analyze.

    A warning may appear related to the assignment of unique numeric IDs for sharing web layers.

  9. If the warning appears, double-click the warning. In the Map Properties window, check Allow assignment of unique numeric IDs for sharing web layers and click OK.
  10. If necessary, in the Share As Web Layer pane, click Analyze. Confirm that there are no errors found.
    Note:

    If you encounter an error other than the unique numeric IDs error, read the error's description and resolve it before continuing.

  11. Click Publish.
  12. After publishing is finished, click Manage the web layer.

    Manage the web layer link

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

Enable editing

Next, you'll enable editing for your web layer.

  1. If necessary, on the item page, sign in to your ArcGIS organizational account.
  2. On the ribbon, click Settings.

    Settings button

  3. Under General, for Public Data Collection, check the box for Approve this layer to be shared with the public when editing is enabled.

    Box checked for layer to be shared with public when editing is enabled

  4. Next to General, click Save.
  5. Under Feature Layer (hosted), for Editing, check Enable editing.

    Feature layer editing enabled

  6. Next to Feature Layer (hosted), click Save.

Edit features in a web map

Now that editing is enabled for your layer, you'll add it to a web map and edit some features.

  1. On the ribbon, click Overview.
  2. Click Open in Map Viewer.

    Open in Map Viewer button

    The map opens in Map Viewer.

    Note:

    Depending on your organizational and user settings, you may have opened Map Viewer Classic. ArcGIS Online offers two map viewers for viewing, using, and creating maps. For more information on the map viewers available and which to use, please see this FAQ.

  3. If necessary, in the pop-up window, click Open in Map Viewer or on the ribbon, click Open in Map Viewer.

    Map Viewer opens.

  4. On the Contents (dark) toolbar, click Basemap. In the Basemap pane, choose Dark Gray Canvas.

    Dark Gray Canvas basemap

    The basemap updates on your map.

  5. On the Contents toolbar, click Layers.

    Layers on Contents toolbar

    The Layers pane appears.

  6. On the Layers pane, confirm that the Vienna City Trails layer is selected. On the Settings (light) toolbar, click Edit.

    Edit on the Settings toolbar

    Tip:

    If the Edit tool is not visible, click More to see more tools on the Settings toolbar and click Edit.

    The Editor pane appears.

  7. In the Editor pane, under Edit features, click Select.

    Select tool for feature editing

  8. Click any trail on the map.

    The trail is selected. The Editor pane changes to the Edit feature pane, showing all the attributes, subtypes, 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.

  9. In the Edit feature pane, for Type of trail, choose Hiking trail.

    Type of trail value

  10. Click Trail Length, type 99, and press Enter.

    A warning informs you that the value you entered is out of the minimum and maximum range as defined for this field.

    Warning that says the value is out of range

    Some other fields may 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.

  11. 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 Delete to delete your edit.

  12. At the bottom of the Edit feature pane, click Update.

    The pane changes to the Select feature pane. You'll return to the Editor pane and create a new trail feature.

  13. In the Select feature pane, click the back button. In the Editor pane, under Create features, click Moderate to add a new feature.

    Moderate trail type

  14. On the map, click anywhere to start adding vertices for a new trail feature and double-click when you complete the new trail.

    Completed feature

  15. Click the new feature to display its vertices.

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

    Feature with vertices

  16. To commit your updates, click a location on the map away from the feature you created.

    The Create features pane displays the attributes for the new trail you created.

  17. In the Create features window, update your new trail attributes by typing a name and selecting attribute values from the various lists applied to fields. When you're finished, click Create.
  18. Optionally, save the web map.

In this tutorial, 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, consider revisiting 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 tutorials in the tutorial gallery.