Python for ArcGIS Pro

By William Parker , Silas Toms

Early Access

This is an Early Access product. Early Access chapters haven’t received a final polish from our editors yet. Every effort has been made in the preparation of these chapters to ensure the accuracy of the information presented. However, the content in this book will evolve and be updated during the development process.

Learn more
    Advance your knowledge in tech with a Packt subscription

  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies

About this book

Irrespective of one’s level of expertise with Esri software, a good command of Python is necessary to drive a geospatial environment. Python proficiency makes even an experienced user of Esri technology/software 5–10-times as valuable as a non-coding GIS analyst. Python for ArcGIS Pro explains how to incorporate scripting at each step from mapping to data science, databases, and data services.

The book leads the reader through the major uses of Python programming for ArcGIS Pro - map production, online and offline data management, data analyses, and data visualization. It shows various Python programming options for ArcGIS Pro, and how to integrate them together into a smarter workflow. You’ll learn how to use popular Python packages such as Jupyter Notebooks and pandas to explore and analyze geospatial data, and how to write data engineering scripts to manage ongoing data processing and data transfers. The book concludes with 3 real-world case studies where you’ll apply the concepts you studied earlier.

By the end of this book, you will be able to use Python to perform all the major tasks involved with ArcGIS Pro: automating the production of maps for print, managing data between ArcGIS Pro and ArcGIS Online, creating custom script tools for sharing, and then running data analysis on top of the ArcGIS geospatial library, all using Python.

Publication date:
December 2021
Publisher
Packt
Pages
489
ISBN
9781803241661

 

Basics of ArcPy

Now that you have an understanding of python syntax you can start working with the ArcPy package. ArcPy is the Python package provided by ArcGIS to perform and automate geoprocessing and map production tools tasks. In addition to the geoprocessing tools available in ArcGIS you have access to additional modules, functions, and classes. When combined you can create workflows and standalone tools that simplify and automate complex analysis and map production.

This chapter will cover:

  • Ensuring your Python Environment is set up for ArcPy
  • ArcPy Tools and how to use them in ArcGIS Pro
  • Accessing environment settings in ArcPy
  • Functions in ArcPy
  • ArcPy Modules
 

Checking your ArcPy Install

The ArcPy package allows you access to the geoprocessing function of ArcGIS Pro. Python packages contain multiple modules, functions, and classes. A package is set up with a hierarchical structure and uses dot notation for the modules and functions.

ArcPy is installed with ArcGIS for Pro and ArcGIS Desktop. ArcPy has been used to write Python scripts in ArcGIS since ArcGIS 10.0. It is the official ArcGIS scripting language and can be used to automate analysis and map production workflows. ArcGIS desktop uses Python 2.7, which is currently up to release 2.7.18. ArcGIS Pro uses a new version of Python, Python 3. The most recent release of Python 3 is Python 3.9.5. You can check what version of Python you have installed by going to the Project>Python>Installed Packages and finding Python.

To use the ArcPy package it must be imported. Most scripts start with import statements to allow access to all the modules that are part of the package. To import...

About the Authors

  • William Parker

    William Parker is a GIS Professional with over 15 years of GIS and Python experience. He is an ArcGIS Python programmer for ICF who has led GIS analysis for the EIR/S analysis the California High Speed Rail Project San Jose to Merced and San Francisco to San Jose Sections. In addition, he has led GIS analysis on other large scale environmental analysis projects, automating processes using ArcPy.

    Browse publications by this author
  • Silas Toms

    Silas Toms is a long-time geospatial professional and author who has previously published “ArcPy and ArcGIS” and “Mastering Geospatial Analysis with Python.” His career highlights include developing the real-time common operational picture used at Super Bowl 50, building geospatial software for autonomous cars, designing computer vision for next-gen insurance, and developing mapping systems for Zillow. He now works at Volta Charging, predicting the future of electric vehicles adoption.

    Browse publications by this author
Python for ArcGIS Pro
Unlock this book and the full library for $5 a month*
Start now