Programming ArcGIS 10.1 with Python Cookbook

First and foremost, I have to concede, Packt Publishing recently provided a copy of Programming ArcGIS 10.1 with Python Cookbook to review. Packt provided a copy free of change in exchange for a review on my website. To their credit, there were no expectations or strings attached. I can say whatever I want about the book.

I wish the Programming ArcGIS 10.1 with Python Cookbook (Python Cookbook) had been around when I started attempting to flounder with Python a couple of years ago. The Python Cookbook presents Python scripting as a way for GIS jocks to get stuff done efficiently. The starting point for solutions is ArcGIS for Desktop, typically ArcMap. This makes the Python Cookbook a perfect starting point for a GIS jock who knows nothing about Python, but wants to be able to work smarter, and not harder.

The Python Cookbook starts out with about the fastest introduction to Python I have ever seen. This is not bad. It covers all the major topics quickly, and moves to the real stuff in chapter two. A few references to online resources, the online help at the very least, would be beneficial in this section. If you have never before even poked into Python, this chapter will feel quite overwhelming. My advice is to just plow through this chapter. Definitely read it, possibly even twice. However, do not get too intimidate by this chapter. Charge on to the next one.

The second chapter, if you are GIS jock with no experience with Python, does an excellent job of presenting the Python as a tool for ArcGIS. It covers therelationship of geoprocessing tools to Python scripting, ways to access Python, notably the Python window in both ArcMap and ArcCatalog, and how to find help for ArcGIS Python scripting. This is how I got started, trying to accomplish GIS tasks in the interactive window. I would look up the tool in the help, copy the code sample into the interactive window, change the variables to my data and with liberal trial and error paired with even more liberal cursing... sometimes figured out a solution.

This method of figuring out Python really does make sense if you are a GIS jock already. You can build on your foundation of knowledge. You already know GIS. Learn Python applied to GIS. This makes learning Python so much more relevant, useful and applicable, learning new ways to accomplish annoyingly repetitive tasks. The Python Cookbook, in chapter two, presents the tools and methods to follow this pattern of learning Python. Thankfully though, the following chapters present recipes with explanations reducing the frustration and cursing while learning Python scripting.

Each solution recipe is presented in the philosophy of say it, say it again and say it again. Every recipe starts with an explanation of what the end goal is along with an overview of what tools and steps are going to be performed to get to the end goal. This introduction is followed by through step-by-step instructions littered with screenshots, walking you through the process of creating the solution with a example data downloadable from the Packt website. Finally, this is followed by a conclusion tying the entire thing together. The process is reviewed and the reasoning behind the steps is discussed.

This presentation format works really well for me. It makes it easy to grasp the concepts being presented. If you are like me (few people are, or even have any desire to be), I study by reading aloud. This format works extremely well for this type of studying. I read the introduction aloud, do the exercise steps, and follow it up by reading the conclusion aloud as well. By the end of the chapter, I actually feel like I can walk away and apply the tools and procedures presented.

True, I do already have a pretty good working knowledge of the way ArcGIS and Python work together. Still, there are parts I just have not had the time or reason to throughly dig into. Chapter four, Finding and Fixing Broken Data Links, was new material for me. Following the end of the chapter, I was able to quickly dive in and apply this to my own maps and data.

Finally, at the end, there are excellent appendices added. Although not exactly ArcGIS Python scripting, they are topics closing the circle. So closely related, they cover logical questions arising while learning to script ArcGIS using Python. The appendices cover scheduling tasks, and retrieving, reading and loading text files.

I was particularly drawn to the explanation of xml files in three pages. Not three weeks prior, I had dissected the Import GPX geoprocesisng tool script to figure out exactly this process. It took me almost two days to sort out what is explained in three pages in the Python Cookbook. This alone would have made purchasing the book worthwhile for me.

In all, I was impressed with Programming ArcGIS 10.1 with Python Cookbook. It presents Python from the perspective of a GIS jock. It makes Python accessible to people who know GIS, but are not coding jocks... which includes most GIS jocks. If you work with GIS on a daily basis, loathe repetitive tasks and want to work smarter instead of harder, pick up a copy of Programming ArcGIS 10.1 with Python Cookbook and learn to work smarter, not harder.