Python Scripting for ArcGIS (Python Scripting, 3) 2nd Edition
| Paul A. Zandbergen (Author) Find all the books, read about the author, and more. See search results for this author |
Use the Amazon App to scan ISBNs and compare prices.
There is a newer edition of this item:
Key topics in this book include:
- Python language fundamentals
- Automating geoprocessing tasks
- Exploring and manipulating spatial data
- Working with geometries and rasters
- Map scripting
- Debugging and error handling
- Creating functions and classes
- Creating and sharing script tools
Customers who viewed this item also viewed
Customers who bought this item also bought
Editorial Reviews
From the Author
Those of us who learned our first computer skills back in the days of MS-DOS became familiar with using command prompt to carry out basic tasks. Early versions of ArcGIS for Desktop Advanced (ArcInfo) also relied heavily on a command line interface, in addition to the use of the ARC Macro Language (AML). More recently, however, most software has come to rely on a graphical user interface (GUI) with very limited need to use a command line interface or to write any code. As a result, the majority of current college students taking their first GIS course have never seen any form of code . Although the menu-driven user interface of ArcGIS for Desktop allows for very complicated operations and sophisticated spatial analysis, at some point users will run into tasks that require something more. That's where Python scripting comes in.
In a nutshell, Python scripting allows you to automate tasks in ArcGIS that would be very cumbersome using the regular menu-driven interface. For example, consider having to convert 1,000 shapefiles to feature classes in a geodatabase. You could run the appropriate tool 1,000 times, but surely there must be a more efficient and robust way to do this. That's what Python scripting will do and you will need only a handful of lines of code to carry out this task. About halfway through this book, you will write a script that does exactly this.
This book is designed to make the power of Python scripting available to those who have no experience in writing code. The book starts with the basics, such as what scripting is and how to write and execute simple lines of code. Following that, the book covers how to write scripts that work with spatial data in ArcGIS for Desktop. A good familiarity with ArcGIS for Desktop is assumed, including managing data in ArcCatalog and carrying out basic tasks in ArcMap, such as manipulating data, creating cartographic output, and running tools. You should also be familiar with the basic concepts of GIS, including coordinate systems, data formats, table operations, and basic spatial analysis methods. If you have some experience in writing code in any language, it will be helpful but is not required.
Why Python? A couple of reasons. First, Python is free and open source, meaning it can be freely distributed and shared. Second, it is a powerful and versatile language although still relatively easy to learn. Third, Esri has adopted Python as the preferred language to work with ArcGIS, which is strongly reflected in the functionality introduced in version 10.1.
There are numerous introductory textbooks on GIS and tutorials for learning ArcGIS. Most of them include sections on spatial analysis methods and procedures. However, coverage of Python scripts is not very complete. Although there is no lack of good introductory books on Python, most existing books cover Python without targeting a specific application. Python's role as a "glue" language is explained and demonstrated, but most books remain very general when it comes to how Python works with other programs.
There is no ArcGIS-specific version of the Python language and so you can start learning Python syntax using any of the general Python books. However, the objects we work with in ArcGIS (such as feature classes, polygons, and geoprocessing tools) are very different from the more generic objects used as examples in most existing titles. This makes it difficult for an experienced ArcGIS user to just pick up a general Python book and start writing scripts for ArcGIS. For an experienced programmer who has previously programmed with ArcGIS in either VBA or C++, such a generic Python reference might suffice<em>but other professionals will benefit greatly from a book that covers Python with a very specific focus on writing scripts for ArcGIS.
The primary audience for this book consists of experienced ArcGIS users who want to learn Python but have limited programming or scripting experience. Prior experience with other scripting or programming languages (such as Perl, VBA, VBScript, Java, or C++) will be helpful but is not required. More experienced programmers will also benefit, but the emphasis is on making Python scripting available to the large number of ArcGIS for Desktop users who want to get more out of the functions of ArcGIS without having to become full-time programmers and learning C++. Readers will, however, be expected to have good overall ArcGIS skills and a basic understanding of geoprocessing procedures.
This book is also intended for upper-division undergraduate and graduate courses in GIS. A handful of colleges and universities teach upper-division courses in GIS programming and/or scripting, and this number is expected to increase.
This book contains three major parts. Part 1 covers the fundamentals of geoprocessing in ArcGIS for Desktop as well as the fundamentals of the Python language. Depending on your background and experience, you may already be familiar with some or all of this material. Part 2 covers how to write scripts that work with spatial data. This is really the core of the book and includes chapters on executing tools in Python, describing data, and manipulating and creating data, as well as a number of more specialized tasks. Part 3 covers how to create a tool out of your script and how to share your tool with others. By the end of this book, you will be able to create custom tools that use Python scripting to automate basic tasks in ArcGIS for Desktop.
Each of the 14 chapters in the book is accompanied by an exercise reinforcing the concepts covered in the chapter. All 14 exercises are included on the Data and Exercises DVD that comes with the book. You should first read the chapter and then complete the accompanying exercise before moving on to the next chapter. Depending on your learning style and familiarity with coding, you can try some of the code in the chapters while you are reading it, but you can also first read the entire chapter and then start the exercise. You should complete the chapters and exercises in order since the concepts introduced in each new chapter build on the previous ones.
To do the exercises in this book, you need to have ArcGIS 10.1 for Desktop software installed on your computer, or else download a trial version of the software. See appendix C for instructions on how to download the software. You will need the code printed on the inside back cover of this book to access the download site.
This book will teach you techniques to automate tasks in ArcGIS. Perhaps by the end of the book, you will become a Python aficionado or perhaps you will simply be able to save yourself hours of work by using one of the scripts from the book. Whatever the case, beyond the specific skills of writing Python scripts for ArcGIS, you will also learn the basic logic of writing code. This will be helpful beyond the specific task at hand. My hope is that the book will contribute to demystifying what "writing code" really is for those who may be a little intimidated by it. And to show that writing code is not difficult to learn. Coding as an approach to solving problems is not only very powerful but also has widespread applicability. I sincerely hope this book will allow you to experience this versatility of Python coding.
Paul A. Zandbergen
Albuquerque, NM USA
About the Author
Dr. Paul A. Zandbergen is a professor in the GIS program at Vancouver Island University. His teaching includes courses in introductory GIS, spatial analysis and modeling, spatial statistics, and GIS programming. His research focuses on the robustness of spatial analytical techniques in the areas of crime analysis, environmental science, public health, spatial ecology, and water resources. His research has been funded by the National Science Foundation, the National Institute of Justice, and the National Institutes of Health. He has published over 50 journal articles and book chapters. He is the author of Python Scripting for ArcGIS, published in 2013 with Esri Press. He lives with his family in Vancouver, British Columbia, Canada.
Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Product details
- Publisher : Esri Press; 2nd edition (January 9, 2013)
- Language : English
- Paperback : 368 pages
- ISBN-10 : 1589482824
- ISBN-13 : 978-1589482821
- Item Weight : 2.58 pounds
- Dimensions : 8.07 x 0.94 x 9.87 inches
- Best Sellers Rank: #894,271 in Books (See Top 100 in Books)
- #130 in Remote Sensing & GIS
- #134 in Geographic Information Systems
- #1,041 in Python Programming
- Customer Reviews:
About the author

Dr. Paul A. Zandbergen is a professor in the GIS program at Vancouver Island University. His teaching includes courses in introductory GIS, spatial analysis and modeling, spatial statistics, and GIS programming. His research focuses on the robustness of spatial analytical techniques in the areas of crime analysis, environmental science, public health, spatial ecology, and water resources. His research has been funded by the National Science Foundation, the National Institute of Justice, and the National Institutes of Health. He has published over 50 journal articles and book chapters. He is the author of Python Scripting for ArcGIS, published in 2013 with Esri Press. He lives with his family in Vancouver, British Columbia, Canada.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
There was a problem filtering reviews right now. Please try again later.
I did use another resource, the eBook version of ArcPy and ArcGIS - Second Edition . These two books go well together. Zandbergen's Python Scripting for ArcGIS is well-written but has no practice exercises. Silas Tom's ArcPy and ArcGIS has plenty of exercises and practice datasets but isn't as intuitive when it comes to explanations.
If you know where you want to go and just need some broad guidance, Zandbergen is the way to go. If you need a little more hands-on, I would also check out Silas' Arcpy and ArcGIS.
There is a lot of buy-in necessary to make this work: mostly, beating your head against the programming wall over and over and over and over and over again when little issue pop up that makes things not work. Python at least is somewhat forgiving.
If you are a student in a course where this book is required... buy it. You'll need it for a while if you plan to make GIS a career.
Paul has a thorough understanding of ArcPy and Python and he does a marvelous job teaching the basics and providing some useful inside tips. He is also comprehensive and thorough. For the instructor, you will need to get your lab up to ArcGIS 10.1. For the self-learner, the text comes with a 6-month license along withe data and labs.
No need to wait any longer. This is the text for learning ArcPy and now is the time.
Yes, I am a "shoot first, and ask questions later" type of guy. Jennings' text lets me dive in. But Zandbergen's is a well-written text that covers a number of tools beyond what Jennings treats. Zandbergen's exercises, in accompanying .pdf's, are--not very good. But I keep both books on my desk.
The only one problem is monotonicity. Through chapters, the author show the code without any real-world analysis. So you may feel boring at the middle of this book. To avoid falling into such a pitfall, I recommend you to pull the real data from the web and apply it to the codes shown in this book.
Finally, As is clear from the tittle, this book is exclusively for the people who are using ArcGIS, not for people who wanna conduct geospatial analysis by using python. If you don't have or don't plan to use ArcGIS, this book is not useful.
Top reviews from other countries
Moving from ArcGIS version 9.3 to version 10.1 I looked for help with the newly introduced ArcPy site package and the greatly expanded support for Python in ArcGIS. This is just what I needed to get me up and running.
With its manageable size of 353 pages (there is also an exercise DVD included) the book follows a clear path. Some earlier background in Python scripting is helpful, but not necessary. Python scripting is first introduced in the broader context of the ArcGIS geoprocessing framework, covering topics such as Model Builder, ArcObjects and the new Python window. Then ArcPy is explained further, the use of cursors to access data, working with raster images and interacting with map documents. How to make script tools, and use its parameters. Important and often overlooked subjects such as error handling, classes, environment settings and tools messages are all tackled. Many additional items of interest pass by, such as NumPy.
At some points following along - having meanwhile become more familiar - I would have liked further expansion, for example on handling transactions and the Editor with arcpy.da. Or on the subject of geodatabase versioning. Or on the newly introduced concepts of Python Add-ins and Python toolboxes. But then again, this confirms that the book's goal had been achieved.
WHAT IS MISSING from this book is a systematic listing/index of the Python functionality-by-task that is specific to ARCPY.
This should be a condensed systematic listing/index of the Python functionality-by-task and should show the syntax.
No, the ArcMap Help does NOT do this trick.
There exists a very high-level diagram of the Geoprocessing Programming Model V10 that is apparently informal ( why informal, ESRI ?, when we need V10.2 ? ). The references to ARCPY functionality are scattered through the ArcMap help system. However a document that bridges the gap between "the high-level diagram of the Geoprocessing Programming Model V10" AND "the ArcMap help system for Python" is missing and apparently is nowhere to be found.
A condensed systematic listing/index of the Python functionality-by-task specific to ARCPY would tie together "the Geoprocessing Programming Model V10" and "ArcMap help system". A lot of users would then find it much easer to relate between these two, and subsequently make sooner and better use of Python.









