Chapter 6. The ArcGIS Python API

The suite of client software and GIS developed by Esri, the global leader in GIS, is known as ArcGIS. It’s an API and Python package in one that allows users to query for information hosted in ArcGIS Online or ArcGIS Enterprise. It’s not open source, but Esri’s leadership in the industry has produced quite a lot of free content and tutorials that you can access and explore. I will share a few learning resources, accessible tools, and information that you can access with the ArcGIS Python API. You’ll need to use a Jupyter Notebook and ArcGIS Online to follow along.

Setup

There is a desktop application called ArcGIS Pro as well as a browser-based platform called ArcGIS Online; in this chapter, you’ll be working with ArcGIS Online with the ArcGIS Python API.

Modules Available in the ArcGIS Python API

To extend the standard Python library, the ArcGIS Python API allows access to additional modules, available by dot notation. You can explore them in the documentation, and I will provide more information as we use them in our coding. These modules include:

Arcgis.gis
Connects you to ArcGIS Online
Arcgis.features
Offers functions for working with groups of geographic elements
Arcgis.geometry
Allows input and output of different geometries (points or polygons, for example)
Arcgis.geocoding
Assigns location coordinates for map visualization
Arcgis.geoenrichment
Adds attributes to an area

I use open source or low-cost options when teaching geospatial ...

Get Python for Geospatial Data Analysis now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.