Python For ArcGIS
Abstract
Imagine... You’ve just begun a new job as a GIS specialist for the National Park
Service. Your supervisor has asked you to analyze some wildlife data. She gives you
a specifi c example to start with: One data table (Bird Species) contains a list of over
600 bird species known to be native to North Carolina. Another data table (Bird
Inventory) contains over 5,000 records, each corresponding to a sighting of a particular
bird. Your task is to clean the data, reformat the fi le for GIS compatibility,
and summarize the data by determining what percent of the native Bird Species
appear in the inventory and map the results. Once you complete this, she would like you to repeat this process for historical datasets for the last 10 years of monthly
records. After that, the next assignment will be to answer the same question based
on monthly species inventory datasets for fi sh and invertebrates.
Performing this process manually for one dataset could be time consuming and
error prone. Performing this manually for numerous datasets is completely impractical.
Common GIS tasks such as this provide a strong motivation for learning how
to automate workfl ows.
Python programming to the rescue! This analysis can be performed in single
Python script. You could even use Python to automatically add the sighting locations
to ArcMap® and create a report with the results. You could also add a graphical
user interface (GUI) so that colleagues can run the analysis themselves on other
datasets. This book will equip you to do all of these things and more.
This book is aimed primarily at teaching GIS Python scripting to GIS users who
have little or no Python programming experience. Topics are organized to build
upon each other, so for this audience, reading the chapters sequentially is recommended.
Computer programmers who are not familiar with ArcGIS can also use
this book to learn to automate GIS analyses with the ArcGIS Python API, accessible
through the arcpy package. These readers can quickly peruse the general Python
concepts and focus mainly on the sections describing arcpy package functionality.
The book comes with hundreds of example Python scripts. Download these
along with the sample datasets so that you can run the examples and modify them to
experiment as you follow the text. Where and how to download the supplementary
material is explained in the fi rst chapter. Rolling your sleeves up and trying things
yourself will really boost your understanding as you use this book. Remember, the
goal is to become empowered to save time by using Python and be more effi cient in
your work. Enjoy!