Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By : Donald Eric Pimpler, Eric Pimpler
Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By: Donald Eric Pimpler, Eric Pimpler

Overview of this book

Table of Contents (22 chapters)
Programming ArcGIS with Python Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Selecting features and rows with the Select Layer by Attribute tool


Attribute queries can be executed against a feature class or table through the use of the Select Layer by Attribute tool. A where clause can be included to filter the selected records and various selection types can be included.

Getting ready

The Select Layer by Attribute tool, shown in the following screenshot, is used to select records from a feature class or table based on a query that you define. We covered the somewhat complex topic of queries in an earlier recipe in this chapter, so hopefully, you now understand the basic concepts of creating a query. You have also learned how to create a temporary, in-memory representation of a feature class or table, which is a pre-requisite to using either the Select by Attributes or Select by Location tool.

The Select by Attributes tool uses a query along with either a feature layer or table view and a selection method to select records. By default, the selection method will be a...