ArcGIS Blog

Data Management

ArcGIS Online

Keeping Layers Updated by Appending Features using the ArcGIS API for Python

By Gonzalo Espinoza

Just like our planet, environmental spatial information is dynamic and constantly subject to changes. For example, we increase the number of protected areas, we add stations to networks measuring air quality, or we add new records to temporal data sets such as sea ice or standardized precipitation index. Our environmental layers in ArcGIS Online must be kept updated to reflect these changes. For the cases in which we add new features to existing items in ArcGIS Online, we can leverage the append function of the ArcGIS API for Python.

Appending features to an existing feature service rather than creating a new one, allows the feature service to be preserved across the ArcGIS platform. All connected web maps and apps that includes the updated feature service will be displaying the latest data, including the appended features.

In this blog, we’ll use the Texas Major Aquifers data set to update an item in ArcGIS online using the append function of the ArcGIS API for Python.

Data Preparation

First, we have a feature service and a hosted view of the Major Aquifers of Texas (tx_major_aquifers) which is missing the Trinity Aquifer (green). The feature service item ID is 218b88c26fb240ae9a7c2e2609b07915.

Major Aquifers of Texas

Note: The Major Aquifers of Texas feature service has a hosted view linked to it. Hosted views are ideal for keeping different data representations such as symbology. After updating or overwriting a feature service, a hosted view retains the previous data representation and properties.

Texas Aquifers Items

Second, we have a local geodatabase with the missing polygons of the Trinity Aquifer. We compress the geodatabase into a single zip file (major_aquifiers_trinity.zip).

Trinity Aquifer GDB

Get Texas Aquifers Feature Service

We use the ArcGIS API for Python to retrieve the tx_major_aquifers feature service using the GIS module and an authentication schema.

Notebook Get Item

Add Trinity GDB Item

We use the GIS module to add the local zip file (major_aquifiers_trinity.zip) that contains the Trinity aquifer geodatabase to ArcGIS Online. We provide a dictionary with the item properties such as title, type, and tags.

Notebook Add Item

The Trinity geodatabase is added to our ArcGIS Online content.

Trinity GDB Item

Append GDB to Feature Service

We now append the Trinity geodatabase to the first and only layer (id=0) in the tx_major_aquifers item.

Notebook Append

The Major Aquifers of Texas feature service and its hosted view are now displaying the missing Trinity Aquifer.

Major Aquifers of Texas (complete)

Live Feeds Methodology

The Live Feeds methodology can be used for regular and automated updates of any type of environmental layers. It is a robust and flexible set of tools and methods to overwrite, append, and keep your layers up to date. The Live Feeds methodology can be implemented for regular monthly or yearly updates to layers that are replaced in near-real time every few minutes.

Summary

Environmental layers should be kept updated. For data sets that increase in size by adding features, we can leverage the append function of the ArcGIS API for Python. For advanced, near-real time applications, we can use the Live Feeds methodology tools that were developed for systematic and scheduled updates.

More Information?

Join GeoNet and ask a question to our community of experts.

Share this article

Subscribe
Notify of
0 Comments
Oldest
Newest
Inline Feedbacks
View all comments