Using Select By Location

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.

  1. Click Selection > Select By Location to open the Select by Location dialog box.
    The Select By Location tool
  2. Choose the type of selection that you want to make. Click the drop-down arrow to see your choices.
    Choose your desired selection type
  3. Identify the target layer(s) from which features will be selected and check them on (Display).
  4. Choose the spatial relationship rule that will be used for selection.
    Select the spatial relationship rule from this list.

    See Types of supported spatial queries below for an overview of the selection options.

  5. Specify the source layer that will be used to select features from the target layer.
    Setting the source layer for Select By Location
  6. 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:

Finding features that intersect with point features
Finding features that intersect with line features
Finding features that intersect with polygon features

NoteNote:

There are a few other operators that are equivalent to intersect in specific cases. These include the use of

  • "Are identical to" when comparing point features
  • "Are within a distance of" when specifying no buffer or a buffer distance of zero

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.

Finding features that are within a set distance of points
Finding features that are within a set distance of lines
Finding features that are within a set distance of polygons

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 within
Finding features that are within (contained by) point features
Are within
Finding features that are within (contained by) line features
Are within
Finding features that are within (contained by) polygon features

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.

Are completely within
In the target layer of counties, Dallas County is selected (along with other counties) because it falls completely within Texas.

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.

Finding features that are completely within polygon 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."

Contain
Finding features that contain point features
Contain
Finding features that contain line features
Contain
Finding features that contain polygon features

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.

Completely contain
Finding polygon features that completely contain point, line, or polygon 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.

Have their centroid in
Finding features that have their centroid within a distance of point features
Have their centroid in
Finding features that have their centroid within a distance of line features
Have their centroid in
Finding features that have their centroid within a distance of polygon 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.

Share a line segment with
Finding features that share a line segment with line features
Share a line segment with
Finding features that share a line segment with polygon features

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.

Touch the boundary of
Finding features that touch the boundary of line features
Touch the boundary of
Finding features that touch the boundary of polygon features

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 identical to
Finding features that are identical to other features

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.

Are crossed by the outline of
Finding features that are crossed by the outline of line features
Are crossed by the outline of
Finding features that are crossed by the outline of polygon features

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.

Contain (Clementini)
Finding features that contain point features
Contain (Clementini)
Finding features that contain line features
Contain (Clementini)
Finding features that contain polygon features

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.

Are Within (Clementini)
Finding features that are within (contained by) point features
Are Within (Clementini)
Finding features that are within (contained by) line features
Are Within (Clementini)
Finding features that are within (contained by) polygon features

Related Topics


8/2/2012