3.10 Esri ArcGIS API for Python

Esri’s ArcGIS API for Python was announced in summer 2016 and was officially released at the end of the same year. The goal of the API as stated in this ArcGIS blog accompanying the initial release is to provide a pythonic GIS API that is powerful, modern, and easy to use. Pythonic here means that it complies with Python best practices regarding design and implementation and is embedded into the Python ecosystem leveraging standard classes and packages (pandas and numpy, for instance). Furthermore, the API is supposed to be “not tied to specific ArcGIS jargon and implementation patterns” (Singh, 2016) and has been developed specifically to work well with Jupyter Notebook. Most of the examples from the API’s website actually come in the form of Jupyter notebooks.

We will be using arcgis 2.4.0 for this lesson. You can read more about arcgis 2.4 in the Release Notes here and see the full list of deprecated items here. For 2.4, the most significant change is the deprecation of the MapView and WebMap, which was migrated into the Map module. It is best to refer to the arcgis python API documentation first, as AI tools may try to suggest using deprecated methods and syntax. The API consists of several modules for:

  • managing a GIS hosted on ArcGIS Online or ArcGIS Enterprise/Portal (module arcgis.gis)
  • administering environment settings (module arcgis.env)
  • working with features and feature layers (module arcgis.features)
  • working with raster data (module arcgis.raster)
  • performing network analyses (module arcgis.network)
  • working with and automating notebooks (module arcgis.notebook)
  • performing geocoding tasks (module arcgis.geocoding)
  • answering questions about locations (module arcgis.geoenrichment)
  • manipulating geometries (module arcgis.geometry)
  • creating and sharing geoprocessing tools (module arcgis.geoprocessing)
  • creating map presentations and visualizing data (module arcgis.graph)
  • processing and symbolizing layers for the map widget (module arcgis.layers)
  • embedding maps and visualizations as widgets, for instance within a Jupyter Notebook (module arcgis.map)
  • processing real-time data feeds and streams (module arcgis.realtime)
  • working with simplified representations of networks called schematics (module arcgis.schematics)
  • building and deploying low-code web mapping applications using templates and frameworks (module arcgis.apps)
  • training, validating, and using deep learning models for imagery and feature data (module arcgis.learn)
  • managing authentication workflows including OAuth 2.0, PKI, and token-based security (module arcgis.auth)
  • creating and executing data engineering workflows using pipeline-based transformations (module arcgis.datapipelines)

You will see some of these modules in action in the examples provided in the rest of this section.

While you are working through this section, you shouldn't have to install any new packages into the environment we created earlier. If you run into issues with the map or widgets not displaying in the Notebook, please reach out to the Professor for assistance before modifying your environment.