ArcGIS Blog

Analytics

ArcGIS API for Python

The Year of the ArcGIS API for Python

By John Yaist

Introduced in December 2016, by July 2017 the ArcGIS API for Python team powered its way to the release of a second major version, version 1.2.  Version 1.2 of the API changed your life in the areas of administration, visualization and analysis:

Administration

On top of the already great time-saving automation capabilities in the API, additional changes to the code base increased your abilities to administer your Web GIS through managing credits and building an entire distributed GIS by creating gis collaborations.  Two new modules provided a whole new set of capabilities for portal administrators. The arcgis.gis.admin module let you modify the portal interface, providing a new user experience of the portal website. The arcgis.gis.server module brought the capability to manage and automate any federated server to the table. The Feature Layer object eased management burden through overwriting functions and better support for attachments.

Visualization and Analysis

All the data wrangling, time-series management, and merging power of the Pandas dataframe was available through querying a Feature Layer, but 1.2 introduced the Spatial Dataframe class in the features module which allowed all that functionality to now be used with geometries. Direct instantiation of this lightning-fast processing structure from feature classes, cloud files and feature layers became reality, and in addtion to the complex data analysis and manipulations inherently suited to the dataframe, the plotting capability provided a way for Python enthusiasts to quickly map dataframes in the entirely familiar format of the matplotlib library.

The combination of ArcGIS geometry structures with Pandas dataframe processing now makes the Spatial Dataframe the perfect structure for integrating ArcGIS with the countless plotting, machine learning, and data science libraries of the whole Python data science ecosystem.

Versions 1.2.1 through 1.2.5

The following 6 months were dedicated to fine-tuning the powerful modular base of the API by cleaning up issues, fixing bugs, and bringing to its knees that most dreaded, despised and oft-ditched software development task: Documentation. The team saw the room for improvement as too large a room in the house, so dedicated resources dug in to improve the overall set of instructions for using the API to get things done!  Guides got published. Samples got uploaded. New and improved function signatures to administer servers, customize portal banners, automate group creation in Enterprise and ArcGIS Online, and support the Living Atlas were just the beginning.  Fixes to output locations and folder searches and error messages all inked and added to the right places to make the API better and more accessible.  The API Reference Documentation got made over, too, as additions like return results as FeatureSet objects from geocoding results were added to the record.

It wasn’t all just fixes, because some support for previously unavailable operations like publishing hosted tile layers from features layers and updating Items from text sources and URLs made their debut in the API.  These bug fixes, doc updates, and function additions added in releases 1.2.1 through 1.2.5 were all laying the groundwork for the next major release.

Version 1.3…Version 1.3! What to say about version 1.3?!?!

Clone_items()…that’s what! One of the more challenging aspects of managing a Web GIS can be making exact copies of the myriad of different items contained within it. Many had the need to maintain a QA portal for testing and development and a straightforward way to move the content into a production portal. Clone_items() is a culmination of earlier scripts that copied content between portals wrapped up neatly into one function, simplifying fundamental tasks necessary for mainting multiple portals, whether ArcGIS Online Organizations or on-premise Enterprises.

While that may have been the big splash, it was not all that had them dancing in the aisles at release 1.3. The abilities to connect to stand-alone servers, search for categories, set and configure the Identity Provider, and fixes to the services.list() function and publishing from SD file operations increased the role the Python API could and should play in Web GIS management and analysis.

Version 1.3 also introduced the VectorTileLayer object so support for all the dynamic, interactive cartography that can be customized and personalized through published vector tile layers can be accessed with the API.  Creating features from and writing features to geojson made the API that much more interoperable with numerous libraries and users familiar with that popular geometry storage format.

To continue the API’s march toward the data analytics platform of choice, a whole slew of raster functions launched onto the scene. Just to name a few:

  • complex – computes magnitude from input raster with complex pixels
  • colormap_to_rgb – converts single-band raster with colormap to 3-band raster
  • grayscale – convers multi-band image into a single-band grayscale image
  • raster_calculator – allows math functions for building expressions
  • See more here!

A new GeoEnrichment module, support for Hosted Feature Layer Views, and the ability to read and write Web Maps also showed up with version 1.3.  With all these major additions, the API continued its march in the right direction and its nearly impossible to capture it all in a blog.

Version 1.4

The API provides an easily accessible, straightforward way to automate Web GIS management. As seen in the progressions through the releases, it thrives in data analytics through interoperating with Python analysis libraries and its own data structures like raster functions, the GeoAnalytics module and the Spatial Dataframe. Version 1.4 integrated further with the Python data science ecosystem through support for the shapely library in the Spatial dataframe. All geometry operations are available on all platforms with the API through this support. Refinements and additions to the GeoAnalytics module make more data from more sources available for intense, distributed computing on big data. This module provides for quicker results using larger amounts of data from both file and cloud sources. The visualization of raster function chains on an Imagery Layer make the analysis capabilities of the API all that more comprehensive.

Another huge breakthrough at 1.4 was the ability to install with pip, allowing for lightweight installations and targeted functionality providing you with exactly what you need exactly how you want it…nothing less.

Version 1.4.1 and 1.4.2

These releases extended the API’s reach further with the Offline Map Area Manager class neatly accessible as the offline_areas property on a Web Map. You can create items and packages for powering ArcGIS Runtime applications. An important new apps module makes way for apps from the whole ArcGIS ecosystem.  Two great apps inaugurate this module: the workforce module intgrates Workforce for ArcGIS and the storymap module initaties with the JournalStoryMap class to represent a Journal Story Map with the API, bringing all the power of Python to working with these apps.

These releases continued the trend of constant documentation improvements to both the API reference and Developer’s Guide, relentless bug and issue fixes reported from you the users, and continual additions and enhancements to the classes, properties and methods establishing the ArcGIS API for Python as an integral tool in your GIS toolset.

What’s next?

Just around the corner awaits another major release of the API…as a foreshadowing since I know you can’t wait…I’ll tell you to think one thing: map widget! Wait…2 things: map widget and AI!

Stay tuned as new functionality is added and current functionality is polished in the ArcGIS API for Python. Beta 1.5 release is soon to come! Be sure to check out all the latest blog posts here so you don’t miss a thing about the API.

Share this article