Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By : Eric Pimpler
Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By: Eric Pimpler

Overview of this book

The book kicks off with the fundamentals of starting to use Python with ArcGIS, followed by recipes on managing map documents and layers, including how to find and fix broken data links in these files. In the second part of the book, you will learn to create custom geoprocessing tools and how to use the Attribute and Location tools to select specific features. The third part of the book covers topics for advanced users including the REST API, and also teaches you how to use Python with ArcGIS Pro. The book finishes with appendices covering how to automate Python scripts, and the five things that should be at the back of every GIS programmer's mind.
Table of Contents (17 chapters)
16
Index

Using the Describe() function to return descriptive information about a feature class


All datasets contain information that is descriptive in nature. For example, a feature class has a name, shape type, spatial reference, and so on. This information can be valuable to your scripts when you are seeking specific information before continuing with further processing in the script. For example, you might want to perform a buffer only on polyline feature classes instead of points or polygons. Using the Describe() function, you can obtain basic descriptive information about any dataset. You can think of this information as metadata.

Getting ready

The Describe() function provides you with the ability to get basic information about datasets. These datasets could include feature classes, tables, ArcInfo coverages, layer files, workspaces, rasters, and so on. A Describe object is returned and contains specific properties, based on the data type being described. Properties on the Describe object are...