This upper-undergraduate textbook teaches students programming in GIS using a mix of computer science theory and hands-on activities, with the aim of empowering students to understand fundamentals and apply their knowledge beyond the specific examples in the book. Each of the book’s twenty-one chapters integrates instructional material with exercises in ArcGIS Pro. In doing so, this book combines the strengths of workbooks and theoretical textbooks to provide a holistic and comprehensive text. Each chapter concludes with an unguided task that ensures students have learned the broader principles explained therein. In addition to its unique format, the book covers oft-neglected topics such as debugging, creating a program from scratch, and managing metadata.
Section I starts with the principles of scripting and programming with Python. Section II introduces the ArcPy module and elements specific to ArcGIS Pro. This section focuses on data structures, and how they are used and implemented within Python. Section III uses the topic of algorithms to guide the student through creating tools to add functionality to ArcGIS Pro. The last section, Section IV, builds upon section III to guide the student to developing and sharing projects and Python packages to include external open-source code and share the Python code as an open-source package.
This text will prepare students for a long-term ability to do GIS programming, whether in industry or academic research. This comes from the author’s observations of students who have learned GIS programming in one platform, such as VBA in ArcMap, struggle to apply that knowledge to a new platform, such as Python in ArcGIS Pro, because the content was presented too closely with a specific platform. The integration of exercises with conceptual content, along with the choice of chapter content, serves this goal of preparing students for working in a dynamic, rapidly changing technology field.
Author(s): Jamison Conley
Series: Springer Textbooks in Earth Sciences, Geography and Environment
Publisher: Springer
Year: 2022
Language: English
Pages: 262
City: Cham
Preface
Contents
Part I: Getting Acquainted with Python
1: Introduction to Scripting and Programming
Introductory Comments: Scripting Versus Programming
Task 1: Why Use Scripting?
Task 2: Algorithms and Computational Thinking
Task 3: Non-guided Work
2: Basics of Programming: Variables, Operators, and Statements
Introductory Comments: Parsing a Line of Code
Task 1: Basics of Python
Variables, Literals, and Operators
Sequences
Strings
Delimiters
Expressions and Statements
Task 2: Finding and Fixing Bugs
Task 3: Unguided Work
3: Basics of Programming: Control Structures
Introductory Comments: Enabling the Computer to Make Simple Decisions
Task 1: Explore the Python Notebook
Task 2: Conditional Statements
Task 3: Loops
Task 4: Parsing Complex Statements
Task 5: Debugging Exercise
Task 6: Unguided Work
4: Basics of Programming: Functions and Objects
Introductory Comments: Managing More Complex Code
Task 1: Functions
Task 2: Objects
Task 3: Parsing Functions and Objects
Task 4: Debugging Exercise
Task 5: Non-guided Work
5: Reading a Python Script
Introductory Comments: The Value of Documentation and Comments
Task 1: Importing a Python File into IDLE
Task 2: Use Online Python Help Documentation to Understand Part of the Script
Task 3: Running Code Statement by Statement to Understand It
Task 4: Using print Functions to Examine a Script
Task 5: Using the next() Function to Examine the Contents of a File
Task 6: Adding Comments to the Code
Task 7: Non-guided Work
6: Debugging
Introductory Comments: The Types of Errors
Task 1: Debugging in the Python Notebook
Task 2: Using the IDLE Debugger
Task 3: Non-guided Work
Part II: Data Structures in ArcPy and Programming
7: Introduction to ArcPy
Introductory Comments: Objects and Classes
Task 1: Reading ArcPy Documentation
Task 2: Accessing and Examining Basic ArcPy Classes
Task 3: Using a Tool Through ArcPy
Task 4: Debugging Exercise
Task 5: Non-guided Work
8: Basics of Accessing Data in ArcGIS
Introductory Comments: Superclasses, Subclasses, and Inheritance
Task 1: Using arcpy.Describe
Task 2: Inheritance of Properties
Task 3: Running an ArcPy Script in IDLE
Task 4: Debugging Exercise
Task 5: Non-guided Work: Writing Your Own Script
9: Rasters
Introductory Comments: GIS-Specific Data Structures
Task 1: Slope Considerations
Task 2: Reclassification
Task 3: Aspect Considerations
Task 4: Map Algebra
Task 5: Debugging Exercise
Task 6: Unguided Work
10: Tables and Cursors
Introductory Comments: How a Computer Represents Tables
Task 1: Introduction to Search Cursors
Task 2: Introduction to Update Cursors
Task 3: Deleting and Inserting Rows
Task 4: More Advanced Use of Cursors
Task 5: Debugging Exercise
Task 6: Writing Your Own Script
11: Vectors and Geometries
Introductory Comments: Data Structures for Points, Lines, and Polygons
Task 1: Access Shape Information
Task 2: Use Geometry-Related Methods
Task 3: Creating New Geometries with Buffers
Task 4: Carry Out Geometry Operations with Two Polygons
Task 5: Creating a New Geometry from Scratch
Task 6: Debugging Exercise
Task 7: Unguided Work
Challenge Task 8
12: Mapping—Symbologies
Introductory Comments: Using UML and Class Diagrams to Manage Complex Objects
Task 1: Basic Mapping Tasks—Adding Layers
Task 2: Changing Layer Properties
Task 3: Changing Symbology
Task 4: Debugging Exercise
Task 5: Unguided Work
13: Mapping: Layouts
Introductory Comments: Data Structures for Maps Versus Layouts
Task 1: Working with the Map Frame
Task 2: Working with Map Surround Elements
Task 3: Working with Text Elements
Task 4: Working with Legend Elements
Task 5: Debugging Exercise
Task 6: Unguided Work
Part III: Creating Algorithms to Enhance ArcGIS Pro
14: Creating Custom Tools
Introductory Comments: Concepts of User Interfaces
Task 1: Create a Custom Tool
About the Application
Task 2. Write a Script for a Custom Tool
Task 3: Sharing the Tool
Task 4: Critical Thinking
15: Error Handling
Introductory Comments: Strategies for Managing More Complex Code
Task 1: Update the Parameter List for the Tool
Task 2: Create Functions to Make the Code More Manageable
Task 3: Adding a Try/Except Structure
Task 4: We Will Now Fill in the Two Intermediate Functions
Task 5: Run the Script in the Tool and Further Improve Error Handling
Task 6: Debugging Exercise
Task 7: Unguided Work
16: Creating Custom Classes
Introductory Remarks: Strategies for Creating and Managing Classes
Task 1: Update the Tool Dialog Box
Task 2: Plan Out the Classes with UML, Flow Charts, and Pseudocode
Task 3: Create Shells of the Classes
Task 4: Fill in the Shells of the Classes
Task 5: Debug the Code
Task 6: Unguided Work
17: Putting It All Together
Introductory Comments: Turning Specifications into a Program
Illustrative Example
Unguided Work
Specifications for Tools
Part IV: Sharing Your Work with Others
18: ArcPy for Web GIS Using ArcGIS Online
Introductory Comments: Shared Services
Task 1: Add Data from on Online Source
Task 2: Use a Tool That Accesses an Online Service
Task 3: Create your own online service
Task 4: Provide Metadata About Your Service
Task 5: Unguided Work
19: Incorporating External Packages
Introductory Comments: Python Modules
Task 1: Turning a Feature Class into a numpy Array
Task 2: Using a numpy Function
Task 3: Preparation for Connecting ArcGIS with R
Task 4: Creating a Tool in ArcGIS to Use an R Script
Task 5: Examining the R Script
Task 6: Unguided Work
20: Using Multiple Python Files
Introductory Comments: More Complex Programming and UML
Task 1: Construction of UML-Like Diagrams
Task 2: Plan the Components of the Files
Task 3: Write the Python Code for summarize.py
Task 4: Write the Python Code for multiCursor.py
Task 5: Write the Python Code for PValue_ch20.py
Task 6: Unguided Work
21: Developing a Custom Python Package
Introductory Comments: Python Packages
Task 1: Turning the MultiCursor and Summarize Files into a Formal Package
Task 2: Telling ArcGIS Pro to Access the Package
Task 3: Editing the Code to Work in an ArcGIS Pro Python Toolbox
Task 4: Examining the Tool
Task 5: Unguided Work
Concluding Remarks
GIS Algorithms
Web GIS
Open Source GIS
Appendix: Unified Modeling Language (UML)
Class Diagram: A Single Class
Class Diagram: Connecting Multiple Classes
Object Diagram
References
Index