Best practices for using feature templates

Getting started with feature templates

Creating features is accomplished through the use of feature templates. Feature templates define all the information required to create a feature: the layer where a feature will be stored, the attributes a feature is created with, and the default tool used to create that feature. Templates also have a name, description, and tags that can help you find and organize them. If templates are not present when you start editing, they are automatically created for each layer in the current editing workspace. Templates are saved in the map document (.mxd) and the layer file (.lyr).

Cases wherein feature templates are created automatically for you

When you start editing, ArcMap checks to see which layers have feature templates. If a layer has no templates, templates are created automatically based on the layer's current symbology. Although templates are generally created for all types of symbology, templates work best for layers symbolized by categories, single symbol, or representations rather than with quantities or charts.

If you add a layer to the map in the middle of an edit session and want to create features in it, you need to make the layer's templates yourself by using the Create New Templates wizard. This allows you to symbolize your layer properly first and ensure the templates will reflect the features you actually want to create. However, anytime you add a layer file (.lyr), the existing templates saved in the layer appear in the Create Features window.

If you delete all the templates in a layer, they are not regenerated for you. You must create them yourself with the wizard if you later decide you want to create features in that layer.

Reasons why some feature templates are not displayed in the Create Features window

Sometimes you may find that certain feature templates are not displayed on the Create Features window for layers that you are currently editing. Keep in mind that templates are always synchronized with the contents of the map; if you turn off a layer in the table of contents, the layer's templates are not shown on the Create Features window. This ensures that the features you create are always displayed on the map rather than immediately disappear because the layer is not visible.

When feature templates for editable layers are not being displayed, a message appears at the top of the Create Features window. Click it to see a list of any hidden feature templates and get an explanation why they are not being shown. The following are the main reasons why templates for editable layers are hidden and what you can do to make them appear on the Create Features window:

When working with definition queries, only feature templates with default attribute values that satisfy the query are listed on the Create Features window. For example, if you have a definition query to display just the major roads in a layer containing several different road types, you only see the feature templates that have the road type default attribute value of major roads. To update the default attribute value, open the Organize Feature Templates dialog box, click the layer's name, open the properties for the template you want to use, then set a value that matches the definition query—in this case, set the road type field to major roads. However, if you also need to add minor roads features, you should first update the definition query on the Layer Properties dialog box to make the minor roads display on the map, then you can create templates with those default attributes.

In addition to these reasons, templates can be hidden because you have an active filter on the Create Features window. For example, when you perform a search for templates, only the ones matching the search are shown. To clear filters, click Arrange Templates By Grouping and Filtering and click Show All Templates.

Before you start creating new templates, it's a good idea to click the layer's name on the Organize Feature Templates dialog box to see if any templates already exist in that layer. This may save you from making new templates that are duplicates of the existing ones.

Creating new feature templates

To create feature templates, open the Organize Feature Templates dialog box from the Create Features window and start the Create New Templates wizard. The wizard steps you through the quick process of making a template: first, you choose the layer or layers; then, if applicable, choose any or all classes within that layer to make into individual templates. Once the templates are created, you can change their default properties, copy and paste them, or delete them.

You can make a copy of an existing template to use it as the basis of a new template. For example, if you want a different default attribute for one of the fields in the layer, copy and paste the template, then change the new template's properties. This saves you from going through the wizard to make just a slight change to a template.

If you add a layer to your map, significantly change the symbology used to draw the features, or add a symbology category (such as for a layer drawn with unique values), you need to create new templates to be able to add features in that layer.

Create New Templates Wizard

Setting a feature template's properties

The default attribute values are some of the most important properties you can set for a feature template. The attributes set on the Template Properties dialog box are assigned to new features created with that feature template. Setting the appropriate default values saves you time and improves accuracy, since the attributes are populated automatically in the new features.

Each template has a default construction tool, which you can set in the template's properties. Setting the default tool can help you avoid an extra click to choose a different tool to create new features. For example, when you are drawing rectangular building footprints, set that template's default construction tool to the Rectangle tool so that tool automatically becomes active when creating building footprints. You can always override the default tool and choose a different one in the Create Features window.

Template Properties dialog box

Feature templates in editing commands

Some editing commands, such as those on the Editor menu, use a dialog box to allow you to choose a template when creating new features.

The template specifies the layer where a feature will be stored and the default attributes for the new features. For a template to be listed in the window, it must already exist and must be the appropriate target geometry type; other template types are filtered from the list and not shown.

Editing commands that can only output one type of geometry (such as Copy Parallel, which only produces lines) list templates just for that layer type. Commands that can output a variety of layer types list any existing templates that are the proper types. For example, the Buffer command can create either line or polygon features, so line and polygon templates may both be listed in the window. If you have created templates for a line layer but not for a polygon layer, only the line templates are listed in the window because there are no available polygon templates in the map. In that case, to choose a polygon as the output, close the command's dialog box, launch the Create New Templates Wizard from the Create Features window, then create a template for the polygon.

Choosing a feature template when using an editing command

If you have no templates at all for any of the layers in your map, you can choose from a list of available layers in which to create the new features. However, if you have templates for only certain layer types, a message appears if you attempt to use a command that requires templates for a different type. For example, when using Copy Parallel, if you have a template in the map for a polygon but no line templates, a message tells you to create line templates to use the command.

When copying features, however, you choose the layer in which to store the new feature. This allows you to retain the attribute values from the copied feature rather than having them be overwritten with values from a feature template. This applies to commands such as Paste and Copy Features.

Finding and organizing feature templates

You can search for templates on the Create Features window. When you search, only the templates that satisfy your query are shown on the Create Features window. To find and identify templates more easily, give them clear and descriptive names. This also applies to the layers and symbol labels, since they provide the default template names. You can enter a description, which appears as pop-up text when you rest your pointer over a template. The Description property allows you to provide additional information about the contents and intended use of a particular template.

Template Properties with a description and tags

In addition, you can add tags to a template. A tag is generally a short keyword, metadata item, or any other term that helps to identify a template when searching for it. Tags can be used as a form of categorization so only the templates that meet certain criteria are displayed on the Create Features window. For example, you are creating polygon features representing animal habitats. You can tag your feature templates to filter them by habitat type so you only see the habitats that apply to certain animals. When you are creating a grizzly bear habitat polygon, you can hide the feature templates for marine and desert environments, which are locations where grizzly bears are not likely to reside.

There are several different ways to sort and group templates on the Create Features window. If you have many templates in your map that are not currently being used, consider hiding them with a filter (such as only showing certain types of layers), rather than deleting them altogether. This way, you can access them again when you need them. This can help minimize the list of items shown on the Create Features window so you can easily find the templates you want. You can also search through the templates to choose the ones you want and hide the others.

Updating feature template properties

If you find that you want to change the default attribute values for new features or repeatedly switch from the default tool to a different one, update the properties of the template.

The Organize Feature Templates dialog box allows you to set the properties of multiple feature templates in a layer at the same time. To do this, select the templates, click Properties, then update the default construction tool or attribute values, for example. Only change the properties you want to apply to all the selected templates.

NoteNote:

The symbol for a template is read-only on the Template Properties dialog box. This is because the template properties simply reflect the current symbology set on the Layer Properties dialog box. If you want to change the symbol used for a template, you need to change it on the Symbology tab of the Layer Properties dialog box. In some cases, the template cannot draw the symbol, such as for certain <All other values> entries when drawing a layer with unique values. In those cases, you need to update the layer properties.

Keep in mind that templates are used only at the time a feature is created. Once a feature is created, there is no link back to the template. If you update the default attribute values of a template, for example, those attribute values are not retroactively applied to existing features. Changes made to a template's properties are only reflected in new features created with that template after the change has occurred. To update the attribute values of a feature that has already been created, use the attribute table or the Attributes window.

Creating multiple feature templates for the same symbology

You can create multiple templates for a layer even if you are symbolizing with a single symbol. You might do this when you have a layer that should all be displayed the same way but the features you want to create have different attribute values. For example, if you are creating lines to represent pipeline features, you could create several feature templates with different default attributes for the common types of material or diameter sizes.

Deleting unnecessary feature templates

Delete the templates you are not using. For example, if you have 10 layers in your map but are only creating new features in two of them, delete the other templates so it makes it easier for you to find the templates you need.

If you have changed the rendering of several layers since the templates were initially created, it may be best just to delete all your templates and start again so the templates are synchronized better with your current symbology. Once you delete them, simply start the Create New Templates wizard and make templates for only the layers in which you want to create features.

A better practice, however, is to spend some time preparing the map and its symbology prior to actually starting editing and creating templates.

Creating maps to share with other editors

If you are creating a map that other editors will use, you should ensure that all the elements necessary to create features are easy to understand by all the editors. This involves clearly naming layers and symbol labels, since these are used to identify the feature templates on the Create Features window. This also applies when you are serving the map through ArcGIS for Server, as editors who edit the contents of the map through the web or by downloading the data locally also receive the feature templates from the map.

Related Topics

6/20/2012