Combining a spatial and attribute query with the Select by Location tool

There may be times when you may want to select features using a combined attribute and spatial query. For example, you might want to select all burglaries within the Edgewood school district that occurred on a Monday. This can be accomplished by running the Select by Location and Select by Attributes tools sequentially and applying a SUBSET SELECTION selection type.

Getting ready

This recipe will require that you create a feature layer that will serve as a temporary layer, which will be used with the Select by Location and Select Layer by Attributes tools. The Select by Location tool will find all burglaries that are within the Edgewood School District and apply a selection ...

Get Programming ArcGIS with Python Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.