Learning ArcGIS Python Scripting

Learning ArcGIS Python Scripting

3h 39mIntermediate2024-03-29

Authors

Jennifer Harrison

Jennifer Harrison

President of TeachMeGID

Course details

Have you ever needed to find all the broken links in a set of map documents? Or convert units before loading map data? Python is the gateway for automating common GIS tasks. Are you ready to get up to speed? In this course, designed for experienced ArcGIS users, join instructor Jennifer Harrison—the founder of TeachMeGIS—as she shows you how to produce faster, deeper insights into your GIS data by adding Python scripting to ArcGIS.

Start with an overview of the basics, including strings, variables, and conditional statements. Jennifer helps you get comfortable writing scripts in IDLE, the integrated development environment for Python. Explore the skills required for writing output to the screen, passing command-line arguments into scripts, using list functions to get to the ArcGIS objects, and reading from and writing to a log file. By the end of this course, you’ll also be prepared to attach your script to a tool in ArcGIS Pro and create help documentation for a script tool.

Skills covered

ArcGIS ProEsriGISAECLearningProgramming LanguagesData ScienceSoftware Development

Concepts

Introduction

  • Getting started with Python in ArcGIS
  • What you should know before watching this course
  • ArcGIS project files throughout this course

Introduction to Scripting and the Python Language

  • Scripting overview
  • Where Python is used in ArcGIS
  • Where to write your scripts - ArcGIS Notebooks
  • Write your first Python script
  • Python syntax rules
  • Comments and pseudocode

Strings, Numbers, and Variables

  • Use variables to make scripts flexible
  • Work with numeric values
  • Work with strings
  • Working with strings in ArcGIS
  • String manipulation
  • String methods and functions

Getting to ArcGIS with Python

  • Object-oriented programming (OOP) overview
  • Incorporating Python libraries in a script
  • The ArcPy library
  • Writing a script that uses ArcPy
  • ArcPy objects, properties, and methods
  • Geoprocessing with Python and ArcPy
  • Model builder for jump-starting your script
  • The ArcGIS API for Python library - Getting to web GIS

Using List Functions to Get to the ArcGIS Objects

  • Working with lists
  • List methods and functions
  • Use loops to work with lists
  • Write a script using list methods and a for-loop
  • Nested loops
  • Conditional statements
  • Write a script using ArcGIS API
  • Getting to the properties of GIS data with Describe
  • Challenge - Properties of layers
  • Solution - Properties of layers

Reading from and Writing to a File

  • Read from and write to a text file
  • Write a script that reads from and writes to a file
  • Write a script that records broken links
  • Challenge - Describe feature classes and write to a file
  • Solution - Describe feature classes and write to a file

Attaching Your Script to a Tool in ArcGIS Pro

  • Making scripts dynamic
  • Creating a custom toolbox

Creating Help Documentation for a Script

  • Creating help documentation for a script tool

Conclusion

  • Next steps and additional resources
80,000 Toman