ArcPy and ArcGIS – Geospatial Analysis with Python
ArcGIS, the GIS software from industry leader ESRI, allows for the analysis and presentation of geospatial data.
The integration of Python into ArcGIS has made the ArcPy module an important tool for GIS students and professionals. The ArcPy module provides a powerful way to improve productivity when performing geospatial analysis. From basic Python scripting through advanced ArcPy methods and properties, ArcPy and other Python modules will improve the speed and repeatability of any GIS workflow.
This book will guide you from basic Python scripting to advanced scripting tools. It focuses on geospatial analysis scripting and touches on automating cartographic output. By the end of this book, you will be able to create reusable modules, add repeatable analyses as script tools in ArcToolbox, and export maps automatically. By reducing the time-consuming nature of GIS from days to hours, one GIS professional can become as powerful as a whole team.
Chapter 1, Introduction to Python for ArcGIS, offers a quick introduction to the basics of Python, including other uses for the programming language. It covers Python data types and important modules used throughout the book.
Chapter 2, Configuring the Python Environment, is an introduction to how Python works: its folder structure, executables, and modules. It also explains importing modules into scripts, the built-in modules, and covers Integrated Development Environments (IDEs), are powerful programming aids.
Chapter 3, Creating the First Python Script, demonstrates how to use ArcGIS ModelBuilder to model the first analysis and then export it as a Python script. String manipulations and how to use file paths in Python are also introduced. Preface
Chapter 4, Complex ArcPy Scripts and Generalizing Functions, examines how to perform analyses and produce outputs that are not possible using ModelBuilder. By using functions, or reusable code blocks, repeating code is avoided.
Chapter 5, ArcPy Cursors – Search, Insert, and Update, covers ArcPy data access cursors and how they are used to search, update, or insert records in feature classes and tables. It explains the quirks of iterating using cursors, and how to only select or update the records of interest.
Chapter 6, Working with ArcPy Geometry Objects, explores ArcPy Geometry objects and how they are combined with cursors to perform spatial analysis. It demonstrates how to buffer, clip, reproject, and more using the data cursors and the Arcpy geometry types without using ArcToolbox.
Chapter 7, Creating a Script Tool, explains how to make scripts into tools that appear in ArcToolbox and are dynamic in nature. It explains how the tools and scripts communicate and how to set up the ArcTool dialog to correctly pass parameters to the script.
Chapter 8, Introduction to ArcPy.Mapping explores the powerful arcpy.Mapping module and how to fix broken layer links, turn layers on and off, and dynamically adjust titles and text. It shows how to create dynamic map output based on a geospatial analysis.
Chapter 9, More ArcPy.Mapping Techniques introduce Layer objects, and their methods and properties. It demonstrates how to control map scales and extents for data frames, and covers automated map export.
Chapter 10, Advanced Geometry Object Methods, expands on the ArcPy Geometry object methods and properties. It also explains how to create a module to save code for reuse in subsequent scripts, and demonstrates how to create Excel spreadsheets containing results from a geospatial analysis.
Chapter 11, Network Analyst and Spatial Analyst with ArcPy, introduces the basics of using ArcPy for advanced geospatial analysis using ArcGIS for Desktop Network Analyst and Spatial Analyst Extensions.
Chapter 12, The End of the Beginning, covers other important topics that need to be understood to have a full grasp of ArcPy. These topics include the Environment Settings, XY values, and Z and M resolution