7. Select by Location¶
Goal: Use spatial relationships to filter features. The companion of Select by Attributes.
Where to find it¶
Map ribbon → Select by Location, or Geoprocessing tool: Select Layer By Location.
The dialog¶
Input Features: [the layer to select FROM]
Relationship: [intersect, within, contains, …]
Selecting Layer: [the layer that defines the spatial filter]
Search Distance: [optional — use for "within X meters"]
Selection Type: [new / add / remove / subset / invert]
Spatial relationships¶
| Relationship | Meaning |
|---|---|
| Intersect | Any overlap (most common) |
| Within a distance | Within X meters/feet of |
| Contain | Input contains selecting feature |
| Within | Input is fully inside selecting feature |
| Are identical to | Exact geometric match |
| Are crossed by | Line crosses through |
| Touch the boundary of | Share a boundary, no interior overlap |
| Have their center in | Polygon centroid in selecting feature |
| Share a line segment with | Topologically connected |
Classic patterns¶
"Schools within 1 mile of a major road"¶
Input Features: Schools
Relationship: Within a distance
Selecting Layer: Major Roads
Search Distance: 1 Miles
"Census tracts that intersect the floodplain"¶
"Parcels fully inside Fulton County"¶
"Cities that contain at least one airport"¶
Combining attribute + location¶
Real workflows combine both. Two patterns:
A. Sequential¶
- Select by Attributes to filter the input first.
- Select by Location with Subset selection.
B. Within a query¶
For most cases, run them as separate steps and inspect the count after each. Easier to debug.
Coordinate system reminder¶
Distance-based selections use map units. If your layer is in WGS84 (lat/long), "1 mile" is meaningless — Pro will warn you. Project to a CRS in feet or meters first.
→ See Coordinate Systems & Projections.
Convert selection to layer¶
After any selection, right-click → Selection → Convert Selection To Layer. Now you have a separate, persistent layer that's only the selected features.
Selection vs Spatial Join¶
| Selection | Spatial Join |
|---|---|
| Highlights features | Creates a new feature class |
| Doesn't transfer attributes | Combines attributes from both layers |
| Use to filter | Use to attach data |
→ See Spatial Join.
Practice¶
Multi-step location query
- Add: streets, hospitals, county boundary.
- Project all to State Plane.
- Select streets Within a distance of 500 m of hospitals.
- Subset that selection to streets that Are within the county boundary.
- Convert selection to layer → label as "Hospital access streets, in-county".
→ Next: Joins & Relates.