ArcWatch: Your e-Magazine for GIS News, Views, and Insights

March 2010

Building Models That Let Users Interact with Maps


Geoprocessing models can be designed to allow users to interactively draw or add input data when they run the model. This is accomplished by modifying a geoprocessing tool's input data type in ModelBuilder to either Feature Set or Record Set, depending on the type of input expected.

Feature sets and record sets are useful for a variety of applications. For example:

Defining the clipping polygon in this model as a feature set gives the user the ability to define the polygon by drawing on the map when the model is run.
Changing the Properties of a Feature Set Parameter in a Model
When running the model, users are presented with a dialog box that allows them to choose Add features interactively (to draw on the map) or Use features from (to point to existing data).

Changing an input data type in ModelBuilder to Feature Set will provide the user with the ability to create and, optionally, populate attributes for point, line, or polygon features on the fly. For instance, if a user needs to build a model that takes the input features drawn by another user and copies them into a new feature class, populating the attribute information, as well as drawing the features interactively, can be useful. Changing an input data type in ModelBuilder to Record Set will give the user the ability to create a table on the fly.

When using feature set or record set inputs to allow for interactive feature creation, a user needs to define the schema of the features. For feature sets, the schema definition will define the geometry and associated attributes the user can draw and enter. In addition, the schema can also supply symbology definitions to be used when displaying the features. There are three options for doing this—import either a feature class, a feature layer, or a layer file. For record sets, the schema definition defines the attributes of each record the user can add. There are four options for defining record set schema—import either a table, a feature class, a layer file, or a table view.

To modify an input's data type to Feature Set or Record Set

  1. Right-click the input variable and click Properties.
  2. Click the Data Type tab and set the data type parameter to either Feature Set or Record Set.
  3. Import the schema by either choosing a layer or table view from the drop-down list or browsing to a table, feature class, or layer file on disk.

Once you have completed this process on one of your own models, any user running the model will be presented with a dialog that allows them to add features interactively.

To learn more, visit the help articles Creating a Simple Model, Feature Sets and Record Sets, and Using the Interactive Feature and Record Input Controls.

Models that allow users to enter data interactively are more powerful than those that require data that already exists. Feature sets and record sets enable this capability. Any existing model that uses a table or feature class as an input can be modified to accept data created on the fly. Take models to a new level of flexibility by making them interactive!

Contact Us | Privacy | Legal | Site Map