Intermediate Python Programming with “ArcGIS Blueprints” – book review

The book “ArcGIS Blueprints” from Eric Pimpler is an excellent choice for intermediate-level ArcGIS Desktop programmers who want to take their development skills to the next level. Read on to find out why.

0

“ArcGIS Blueprints” is a book for ArcGIS Desktop programmers who want to improve their Python programming skills and look beyond Python scripting. Whereas the author´s earlier book “Programming ArcGIS with Python Cookbook” focused on Python scripting, this book covers ArcGIS Desktop application development with Python. These applications come in the form of add-ins and Python toolboxes, two features introduced in ArcGIS 10.1. Both extend the current capabilities of the application and give you the opportunity to re-use and share these self-made tools with others. As such, they’re providing a great added value to current functionality and becoming more and more a prerequisite in the current job market. Application development is definitely a great skill to have and this book is a great way to learn this. The book is written for ArcGIS Desktop 10.3.

Python Toolboxes and Add-ins

The book is divided into ten chapters. An additional appendix gives an overview of the Python libraries for ArcGIS and should be read before starting with the first chapter. Each chapter is set up as a project where you’ll build several tools that can be used together, just like you would when you’d use multiple geoprocessing tools in a single workflow. Most of the time is spent on building Python toolboxes. These can combine multiple tools in one single script that make use of both Python scripting and programming techniques. This means that if you know how to write Python scripts, you’re already well underway. Python toolboxes are created and accessed through the ArcCatalog window and stored in a separate toolbox that can be recognized by having a .pyt extension.

Add-ins are another story: these are tools that also have a GUI (Graphical User Interface), such as a toolbar with a set of buttons. You need a special Python Add-In Wizard to create these toolbars and install them after writing the code for the tools inside the add-in. You might ask yourself when to use a Python Add-in instead of a Python toolbox: Python add-ins are used to create functionality that enables you to interact directly with the map window, while Python toolboxes are user-defined toolboxes that give you more control over multiple input and output parameters before running your own scripts that are also included in these toolboxes. The creation of these toolboxes and add-ins is one pillar of the book, the second one is the use of other Python libraries.

Open Source Python libraries

Apart from using the functionality provided by ArcPy, the author included a number of open source Python libraries for creating ArcGIS Desktop applications. This means that throughout the book  you’re instructed to install various open source Python modules that are used to extend current functionality available through the default Python modules and ArcPy, such as requests, csv, plotpy, tweepy, simplekml and wxPython. The requests module is used to make pull requests from the ArcGIS REST API.

Each chapter starts with an introduction of the project, a list of bullet points of the covered topics and a diagram showing the structure for each project. Color screenshots of tool tabs, websites and map windows illustrate the main content of the book, which is the code for the add-ins and Python toolboxes you’ll be building. You’re supposed to type in this code into an IDE that is linked to ArcMap when you create a Python Toolbox or Add-in. (PyScripter is an excellent choice for an IDE, just make sure to set the syntax to “Python” when you open the Toolbox, as its format is not automatically recognized by PyScripter).  Data entry of all the example code in a Python script is very time-consuming, but worth the investment as it enables you to learn from your mistakes.

Challenges

Nearly all of the example code works great so you don’t have to worry about errata throughout the book. But there are some minor challenges that I´d like to point out. For example, when displaying map data in ArcMap, you’ll notice that using different maps in one map layer will cause projection errors, and this happens throughout the book whenever you use a world map as a background to display local data. The solution is to re-project all separate layers in one map projection, but his issue is only addressed once in the book – you’ll need to fix this problem yourself in other cases.

Another issue is the organization of the data that comes with the book. It is recommended to consult the README file before starting with the projects in the book and have a clear understanding of how all data is organized so you know where to store and find it. Finally, the layout of the code in the book is sometimes problematic but this goes for all books from this publishing company. The code files on disk solve this problem.

Verdict

GIS Application development is a skill that is in high demand. This is the only book on ArcGIS application development and Python, so for that only you should consider buying it if you are interested in this topic. As to be expected from this author, he did a great job on creating an interesting and challenging book. The instructions are clear and the exercise data works great. A great plus are the open source Python modules you’ll learn to use along the way. They’re easy to install and free of use.

Beginning Python coders might not want to start with this book as it’s clearly written for intermediate-level ArcGIS Desktop programmers and features little to no explanation about the code in the instructions. This is a logical choice as the book is already quite long and information on Python toolboxes and add-ins is available in the ArcGIS Desktop Help files. Instead, the author chose to focus on the code itself and include as much projects as possible, resulting in a great source with interesting and varying projects that range from retail site selection to crime analysis.