Chapter 9. Listing and Describing GIS Data

In this chapter, we will cover the following recipes:

  • Working with the ArcPy list functions
  • Getting a list of fields in a feature class or table
  • Using the Describe() function to return descriptive information about a feature class
  • Using the Describe() function to return descriptive information about a raster image

Introduction

Python provides you with the ability to batch process data through scripting. This helps you automate workflows and to increase the efficiency of your data processing. For example, you may need to iterate through all datasets on disk and perform a specific action for each dataset. The first step is often to perform an initial gathering of data before proceeding to the main body of the geoprocessing task. This initial data gathering is often accomplished through the use of one or more list methods found in ArcPy. These lists are returned as true Python list objects. These list objects can then be iterated for further processing. ArcPy provides a number of functions that can be used to generate lists of data. These methods work on many different types of GIS data. In this chapter, we will examine the many functions provided by ArcPy to create lists of data. In Chapter 2, Managing Map Documents and Layers, we also covered a number of list functions. However, these functions were related to working with the arcpy.mapping module, and specifically, for working with map documents and layers. The list functions we cover in this chapter reside directly in ArcPy and are more generic in nature.

We will also cover the Describe() function to return a dynamic object that will contain property groups. These dynamically generated Describe objects contain property groups that are dependent on the type of data that has been described. For instance, when the Describe() function is run against a feature class, properties specific to a feature class will be returned. In addition to this, all data, regardless of the data type, acquires a set of generic properties, which we'll discuss shortly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset