loading
X

Creating Python Scripts for ArcGIS

Overview

Description
Time is valuable—learn how to create scripts that will streamline your GIS work. This course teaches how to access the Python environment in ArcGIS Pro, script common data management tasks, and automate geoprocessing workflows. You will learn techniques to share your scripts so they are easily accessible both inside and outside ArcGIS Pro. This course assumes some familiarity with Python and basic programming concepts.

Who Should Attend
GIS analysts, specialists, data processors, and others who want to automate ArcGIS tasks and workflows

Goals
Upon completion of this course you will be able to:
• Apply Python syntax rules, error-handling techniques, and tool validation to create robust scripts in ArcGIS Pro.
• Use lists and loops to repeat geoprocessing tasks within a script to create an efficient, repeatable analysis workflow.
• Use cursors to access geospatial data, edit attributes, and create and modify features.
• Create geoprocessing packages and custom script tools to share your Python scripts with other ArcGIS users.

Prerequisites
ArcGIS Pro: Essential Workflows or Migrating from ArcMap to ArcGIS Pro.

Course Outline

Python automation for your organization
• Benefits of Python automation
• The Python script creation workflow
• Integrating Python in ArcGIS Pro
• Python development environments
• Accessing Python
• Adding Python packages to ArcGIS Pro

Using Python to access geoprocessing tools
• Viewing parameters in a geoprocessing tool
• Explore the syntax of a geoprocessing tool
• Ways to use variables in a script
• Using variables in a script
• Python troubleshooting techniques
• Troubleshooting errors in a script

Using Describe properties in geoprocessing tools
• Accessing properties with a Describe function
• Identify available Describe function properties
• Describe syntax and usage
• Accessing Describe properties
• Using the da.Describe object in a geoprocessing script

Automating Python scripts with lists
• List functions in Python
• Examine the ListDatasets function
• Finishing the List function syntax
• Using a for loop
• Using a for loop to iterate over lists

Working with cursors
• Types of cursors
• Examine cursors
• Determine which cursor to use
• Exploring cursor syntax
• Using cursors in a workflow
• Applying the cursor workflow

Geoprocessing with geometry objects
• Benefits of geometry objects
• Workflows to create geometry objects
• Discovering polyline geometry objects
• Components of a geometry object
• Discover geometry object methods

Error management techniques
• Types of errors that occur in geoprocessing
• Using try-except statements
• Error handling techniques
• Introducing error handling in Python scripts
• Determine the error handling technique

Creating a Python script tool
• Improving script accessibility
• Components of a Python script tool
• Accepting user input
• Parameter identification

Adding validation to script tools
• customizing script tool behavior
• Using validation to create customizations
• Validating script tool inputs using ToolValidator methods

Using Python script tools in the platform
• Methods to share a Python script tool
• Determine the appropriate method
• Workflow to share a Python script tool
• Workflow review
• Sharing a web tool within the ArcGIS platform