Displaying a subset of features in a layer
When you specify a dataset that you want to draw as a map layer, you often only want to draw some of the features in the dataset. In these situations, you can define a query expression to select a subset of features for the layer display. This is referred to as a definition query.
- You may want to display only cities with a population above a certain threshold.
- Many datasets, such as roads and street datasets, have subsets of features (classes), and you may want to define map layers for each class of roads independent of the other features.
- In another case, many users have large enterprise databases with datasets that contain millions of features across wide extents—say for a whole nation or state. Yet, in their maps, they may want to work with only a subset of that data.
If you only want to display and work with a subset of features in a layer, you can apply a definition query to a layer. You can type your own expression, or you can use Query Builder dialog box to help you set up your query expression.
Creating a definition query
- Right-click the layer in the table of contents and click Properties.
- Click the Definition Query tab on the Layer Properties dialog box.
- Enter a query expression. See Building a query expression for more information on how to build valid queries.
- Click OK.
Once you set the definition query, the map will redraw and display the subset of features that are selected using your query. The layer will continue to draw this feature subset each time the map is refreshed.
To add all the features back to the layer, simply delete the definition query.