Programming ArcGIS with Python Cookbook
"Programming ArcGIS with Python Cookbook" by Eric Pimpler is a comprehensive guide that provides more than 75 recipes to assist users in automating geoprocessing tasks, creating solutions, and solving problems using Python in ArcGIS.
The book begins with an introduction to the fundamentals of the Python language for ArcGIS. It covers topics such as using IDLE for Python script development and explores Python language fundamentals. This chapter serves as a solid foundation for readers to grasp the essentials before diving into more advanced topics.
Chapter 2 focuses on writing basic geoprocessing scripts with ArcPy, the Python site package for ArcGIS. It explains how to access ArcPy with Python, execute tools from a script, and utilize variables to store data. The chapter also emphasizes the use of ArcGIS Desktop help for reference.
Managing map documents and layers is the subject of Chapter 3. Readers learn how to reference map documents, access data frames, and retrieve lists of layers and tables in a map document. The chapter also covers techniques for changing map extent, adding and inserting layers, and updating layer symbology and properties.
In Chapter 4, the book delves into finding and fixing broken data links. Readers are introduced to methods for identifying broken data sources in map documents and layer files. The chapter explores different approaches to fixing these broken links, including using the MapDocument class methods.
Chapter 5 focuses on automating map production and printing. It provides recipes for creating lists of layout elements, updating layout element properties, and accessing available printers. Readers also learn how to print maps, export them to PDF or image files, and create map books.
The following chapter, Chapter 6, covers executing geoprocessing tools from scripts. It explores techniques for finding geoprocessing tools, retrieving toolbox aliases, and executing tools from a script. The chapter also highlights using the output of one tool as an input to another and working with environment variables and tool messages.
Chapter 7 introduces readers to creating custom geoprocessing tools. It explains the process of developing custom tools and demonstrates how to integrate them into ArcGIS using Python.
Chapter 8 focuses on querying and selecting data. Readers learn how to construct attribute query syntax, create feature layers and table views, and select features and rows using various tools and criteria.
Chapter 9 delves into using the ArcPy Data Access module for selecting, inserting, and updating geographic data and tables. Readers explore concepts such as retrieving features with a SearchCursor, filtering records, improving cursor performance, and performing insertions and updates within an edit session.
Listing and describing GIS data is the central theme of Chapter 10. The chapter provides recipes for obtaining lists of feature classes in a workspace, restricting the list based on criteria, retrieving field information, and using the Describe() function to obtain descriptive information about features and workspaces.
In Chapter 11, the book introduces readers to customizing the ArcGIS interface with add-ins. It explains how to download and install the Python Add-In wizard, create button and tool add-ins, and install and test them in ArcGIS.
Chapter 12 focuses on error handling and troubleshooting. It covers topics such as Python error messages, exception handling structures, retrieving tool messages, filtering messages by severity level, and responding to specific error messages.
The book concludes with two appendices. Appendix A provides guidance on automating Python scripts, including running scripts from the command line, capturing command-line input, and scheduling batch files. Appendix B presents five practical tasks that every GIS programmer should know how to perform with Python, such as reading data from text files, sending emails, retrieving files from FTP servers, creating ZIP files, and reading XML files.
Overall, "Programming ArcGIS with Python Cookbook" offers a comprehensive collection of recipes and techniques that enable users to harness the power of Python for geospatial analysis and automation within the ArcGIS environment. With its step-by-step approach and practical examples, the book caters to both beginners and experienced users, providing them with the tools to streamline their workflows and solve complex problems.
Throughout the book, Eric Pimpler demonstrates a strong understanding of ArcPy and its integration with Python, guiding readers through the different aspects of scripting and automation. Each chapter focuses on a specific topic and presents a set of recipes that tackle common tasks and challenges faced by GIS professionals.
One of the notable strengths of the book is its emphasis on practical application. The recipes are presented in a clear and concise manner, making it easy for readers to follow along and implement the solutions in their own projects. Pimpler provides thorough explanations of the code snippets, highlighting key concepts and best practices.
Additionally, the book covers a wide range of topics relevant to ArcGIS users. From basic geoprocessing tasks to advanced customization of the ArcGIS interface, readers gain a comprehensive understanding of how Python can enhance their GIS workflows. Whether it's managing map documents and layers, automating map production and printing, or querying and selecting data, the book offers a wealth of knowledge and practical examples.
Furthermore, the inclusion of appendices on automating Python scripts and five essential tasks for GIS programmers adds value to the book. These sections provide additional insights and resources for readers looking to expand their Python skills and explore more advanced techniques.
Overall, "Programming ArcGIS with Python Cookbook" serves as a valuable resource for GIS professionals, analysts, and developers seeking to leverage Python for automating geoprocessing tasks and solving spatial problems. The combination of clear explanations, practical examples, and comprehensive coverage of ArcPy makes this book an indispensable guide for anyone working with ArcGIS and Python.