The Select By Location tool lets you select features based on their location relative to features in another layer. For instance, if you want to know how many homes were affected by a recent flood, you could select all the homes that fall within the flood boundary.
You can use a variety of selection methods to select the point, line, or polygon features in one layer that are near or overlap the features in the same or another layer.
Steps for using Select By Location
Use the following steps to apply the Select By Location tool. Note that you select features from a layer (or a set of layers) that have a spatial relationship with features from a source layer. For example, select features from USA Counties that touch the boundary of the features in the layer named "Texas." The dialog box guides you in specifying each selection property.
- Click Selection > Select By Location to open the Select by Location dialog box.
- Choose the type of selection that you want to make. Click the drop-down arrow to see your choices.
- Identify the target layer(s) from which features will be selected and check them on ().
- Choose the spatial relationship rule that will be used for selection.
See Types of supported spatial queries below for an overview of the selection options.
- Specify the source layer that will be used to select features from the target layer.
- To complete your Select by Location specification, you can optionally specify if you want to
- Use selected features in the source layer to identify the features to select.
- Use a buffer distance in your search (buffer distances are only used with some selection options).
Types of supported spatial queries
The following spatial query methods are supported using Select By Location. In these descriptions, the Target layer is the layer in which features are selected. The Source layer is the layer whose features are used to determine the selection based on its spatial relationship to the target.
In the diagrams, selected features are highlighted in cyan where they intersect, touch, or are contained within the red source features, and so on.
Intersect
Intersect returns any feature that either fully or partially overlaps the source feature(s). Here are some examples:
Are within a distance of
This operator creates buffers using the buffer distance around the source features and returns all the features intersecting the buffer zones. For example, select cities within 100 meters of a river or railroad.
The highlighted cyan features are selected because they fall within the selected distance of the red features.
Are within
To be selected, the geometry of the target feature must fall inside the geometry of the source feature. Selected features and source features can have overlapping boundaries.
For example, using this operator, the state of Montana is selected even if it shares boundaries with the United States.
Are completely within
To be selected, all parts of the target features must fall inside the geometry of the source feature(s) and cannot touch the source's boundaries. For example, in a target layer of counties, Dallas County is selected because it falls within the source polygon of Texas. This would be true for all counties that do not fall along Texas's boundary.
This operator is the reverse of "Completely contain." See more below.
The source feature must be a polygon, or you must apply a buffer around point and line features to use this operator.
The highlighted cyan features are selected because they are completely within the red features.
Contain
To be selected, the geometry of the source feature must fall inside the geometry of the target feature including its boundaries. For example, a polygon representing the United States contains the state of Texas and is selected even though they share common boundaries along their southern borders.
This is the inverse of the operator "Are within."
Completely contain
To be selected, all parts of the target feature must completely contain the geometries of the source feature. In addition, the source feature cannot touch or overlap the target's boundaries. For example, if the source feature is the state of Kansas, a feature representing the United States boundary is selected because it completely contains the state of Kansas and does not touch along its boundaries. However, this is not true if the source feature is Texas because of their shared boundaries. This is the inverse of the operator "Are Completely Within."
The target feature layer must be a polygon.
The highlighted cyan features are selected because they completely contain the red features.
Have their centroid in
A target feature is selected by this operator if the centroid of its geometry falls into the geometry of the source feature or on its boundaries.
The highlighted cyan features are selected because they have their centroids in the red features.
Share a line segment with
With this method, the source and target features are considered as sharing a line segment if their geometries have at least two contiguous vertices in common.
The source and target features must be either lines or polygons.
The highlighted cyan features are selected because they share a line segment with a red feature.
Touch the boundary of
A target feature will be selected if the intersection of its geometry with the source feature is nonempty, but the intersection of their interiors is empty. This is the definition of the Clementini touch operator, so if the target feature touches (as defined by Clementini) the source feature, it is selected.
The source and target features must be either lines or polygons.
The operator includes the Clementini operator but also expands it. An additional case is also supported: an interior line or a polygon completely contained within a polygon is selected if its geometry shares line segments, vertices, or endpoints with the polygon boundary.
The highlighted cyan features are selected because they touch the boundary of a red feature.
Are identical to
Two features are considered identical if their geometries are strictly equal. The feature types must be the same—for instance, you can use this operator to compare two polygon layers, but comparing a point layer and a polygon layer for identity always returns an empty selection.
The highlighted cyan features are selected because they are identical to a red feature.
Are crossed by the outline of
For this operator, the boundaries of the source and target feature must have at least one edge, vertex, or endpoint in common but must not share a line segment.
The source and target features must be either lines or polygons.
Contain (Clementini)
This operator provides the same results as Contain unless the source feature is entirely on the boundary of the target feature, with no part of the source feature inside the target feature. In this case, using the Contain Clementini operator does not select the target feature, whereas the Contain operator does. Clementini states that a polygon's boundary is separate from its inside and outside.
Clementini refers to the "are within" and "contains" topological relationship as defined in the following paper: Eliseo Clementini, Paolino Di Felice, and Peter van Oosterom, A Small Set of Formal Topological Relationships Suitable for End-User Interaction. Proceedings of the Third International Symposium on Advances in Spatial Databases, pp. 277–295, June 23–25, 1993.
The highlighted cyan features are selected because they contain a red feature.
Are Within (Clementini)
This operator provides the same results as Are Within unless the Target feature is entirely on the boundary of the source feature, with no part of the target feature inside the source feature. In this case, using the Are Within Clementini operator does not select the target feature, whereas the Are Within operator does. Clementini states that a polygon's boundary is separate from its inside and outside.
Clementini refers to the "are within" and "contains" topological relationship as defined in the following paper: Eliseo Clementini, Paolino Di Felice, and Peter van Oosterom, A Small Set of Formal Topological Relationships Suitable for End-User Interaction. Proceedings of the Third International Symposium on Advances in Spatial Databases, pp. 277–295, June 23–25, 1993.