Learning ArcGIS Python Scripting (2018)
2h 27mBeginner2018-10-22
Authors
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 like these. Python scripts can be used to manipulate maps, execute commands, and even read and write data from files. Learn how to produce faster, deeper insights into your GIS data by adding Python scripting to ArcGIS Desktop. This course starts with the basics, including strings, variables, and conditional statements. Jennifer Harrison—founder of TeachMeGIS—gets you comfortable writing scripts in IDLE, the integrated development environment for Python, and ramps up to writing output to the screen, passing command-line arguments into scripts, and reading from and writing to a log file. She also introduces the ArcGIS arcpy module for creating map documents and shows how to integrate customized scripting tools into ArcMap.
Learning objectives
Writing and running Python scripts in IDLE
Making scripts flexible with variables
Commenting scripts
Manipulating string data
Object-oriented programming in Python
Creating loops
Reading and writing text files
Capturing input at runtime
Documenting your scripts
Learning objectives
Writing and running Python scripts in IDLE
Making scripts flexible with variables
Commenting scripts
Manipulating string data
Object-oriented programming in Python
Creating loops
Reading and writing text files
Capturing input at runtime
Documenting your scripts
Skills covered
ArcGISEsriGISIntroduction toAECProgramming LanguagesData ScienceSoftware Development
Concepts
Introduction
- Leverage Python in ArcGIS
- What you should know
Python for ArcGIS Basics
- Scripting overview
- Python throughout ArcGIS
- Compose and run scripts in an IDE
- Write your first script
Strings, Numbers, and Variables
- Use variables to make scripts flexible
- Work with numeric values
Syntax Rules
- Basic Python syntax rules
- Comment scripts
- Reserved words
Manipulating Strings
- Special string characters
- Additional manipulations
- String functions
- Help for string functions
Object-Oriented Programming
- Object-oriented programming (OOP) overview
- Objects, properties, and methods
- Incorporating site packages
- ArcGIS Python module
- Basics of ArcPy
- Help for ArcPy
Using Loops
- Use loops to work with lists
- Use the foreach loop
- Help for list functions
- Nested loops
- Conditional statements
Generate Log Files
- Read and write to a text file
- Write multiple records to a file
Input at Run Time
- Making scripts dynamic
- Command-line arguments
- Capture arguments in a list variable
- Work with toolboxes in ArcMap
- Creating a custom toolbox
Help Documents
- Documenting a script
Conclusion
- Next steps