Chapter 9. Using the ArcPy Data Access Module to Select, Insert, and Update Geographic Data and Tables

In this chapter, we will cover the following recipes:

  • Overview of cursor objects
  • Retrieving features from a feature class with SearchCursor
  • Filtering records with a where clause
  • Improving cursor performance with Geometry tokens
  • Inserting rows with InsertCursor
  • Updating rows with UpdateCursor
  • Deleting rows with UpdateCursor
  • Inserting and updating rows inside an edit session
  • Reading geometry from a feature class


We'll start this chapter with a basic question. What are cursors? Cursors are in-memory objects containing one or more rows of data from a table or feature class. Each row contains the attributes from each field in the data source, along ...

Get Programming ArcGIS 10.1 with Python Cookbook 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.