HOW TO
This article explains how to validate the map areas associated with a web map and list the replica IDs generated for each map area. The solution uses the ArcGIS API for Python to retrieve related map areas and inspect the offline packages created from them.
When working with offline-enabled web maps, it may be necessary to verify which map areas are associated with a specific web map and confirm the replica IDs created for offline usage. This validation helps troubleshoot synchronization issues, replica management problems, or unexpected offline behavior.
Portal for ArcGIS/ArcGIS Online do not directly expose this information in the user interface, so it must be retrieved programmatically.
We can validate map areas and their associated replica IDs by querying the web map item and inspecting its related items. Each map area can have one or more offline packages, stored as SQLite geodatabases, that contain a replica ID.
The following script retrieves:
from arcgis.gis import GIS
gis = GIS("home")
webmap = gis.content.get("REPLACE WITH WEB MAP ID")
mapAreas = webmap.related_items("Map2Area")
for mapArea in mapAreas:
print ("----------Map Area----------")
mapAreaId = mapArea.itemid
print ("Map Area with ID: "+ mapAreaId)
print ("Has the following replicas: ")
itemsmapArea = mapArea.related_items("Area2Package")
for itemmapArea in itemsmapArea:
if (itemmapArea.type == "SQLite Geodatabase"):
print("Replica ID: " + str(itemmapArea.properties['replicaID']))
Article ID: 000040973
Get help from ArcGIS experts
Start chatting now