Taking Your Maps Offline: Creating Offline Map Areas

876
0
10-09-2023 05:46 AM
Labels (2)
TomDeWitte
Esri Regular Contributor
3 0 876

Banner.png

 Taking Your Maps Offline: Creating Offline Map Areas

By Mike Hirschheimer, Tom DeWitte, Kevin Ruggiero

Part 4 of 5

Your Utility wants to setup a process that enables field workers to have access to your pipes, conductors, and cabling geospatial data when not connected to the communication network. The GIS/IT support team has read the ArcGIS documentation for offline map areas and is ready to begin. For an initial proof of concept (POC) the team created new web maps and then used the Field Maps Designer web app tools to manually define the extent of a single offline map area.  The feedback from the field has been positive and now leadership wants to expand to cover the entire service territory which includes 100 distinct areas.  The GIS/IT team is super excited about the project moving forward but secretly cringes when thinking about the effort and hours it will take to manually repeat the steps from the POC for the remaining 100+ areas. 

A similar scenario happened to our team earlier this year.  Our customer had 100 “operating areas” throughout their service territory and manually repeating the steps executed in the POC for each offline area wasn’t sustainable.  We needed a way to automate the creation of these 100 offline map areas. The ArcGIS API for Python provided the scripting ability that was needed for this automation.

In this blog, we’ll discuss best practices for managing the web maps along with using the ArcGIS API for Python to create and report on offline map areas.

Configure the web maps

The data that the field worker sees on their mobile device is driven by the layers, tables, and configuration in the web map.  From ArcGIS documentation, we know that a single web map can support up to 16 offline map areas.  With 100 areas to define, a minimum of 7 web maps is needed (100 / 16 = 6.25) if the areas were broken up evenly.  In reality, it took 13 web maps as the ease of use for the field worker was a major factor when making assignments.

Managing 13 web maps can become overwhelming pretty quickly when a single change would need to applied 13 times.  The recommendation is to create a “Master” web map using ArcGIS Pro that includes the facilities, landbase features, the offline enabled base map, and other pertinent data feeds.  Once the configurations like scale ranges, pop-ups, labels, locators, etc. are set, publish the web map to Portal using the Share Tab à Save as Web Map button.  Then the “Master” web map can be copied and given a new name as many times as needed to support our offline map areas requirements. 

NOTE: If using ArcGIS Enterprise 10.9.1 or 11.1, don’t include Subtype Group Layers in your web maps.  The offline map area creation tool will fail because it doesn’t understand Subtype Group Layers.

Creating the Offline Map Areas

There are 2 approaches to create the offline map areas.  The Field Maps Designer web application could be used to manually define polygon extents, or the ArcGIS API for Python could be used to programmatically generate the polygon extents based on the operating area polygon layer most utilities already have.

In the Field Maps Designer web app, there are tools to draw a rectangle or a polygon to define the extent and then enter information about the area (name, how often to refresh, levels needed in the basemap).  For a POC, this approach is quick and easy but doesn’t scale well when moving into production mode.

The programmatic approach uses a Python script to automate the creation of offline map areas.   Attached to this blog is a script that creates offline map areas using a polygon feature’s geometry.  The script uses a configuration file that contains your ArcGIS Enterprise credentials, the URL of your polygon layer of operating areas, Web Map IDs and the instructions for creating the offline map areas.

In this sample configuration file, there are 2 web maps that are defined in the offlineAreaConfig section.

Part 4 Offline Area Config File.png

Part 4 Offline Area WebMaps.png

When the script runs, offline map areas will be created for the polygon features that satisfy the “polygonWhereClause”.  In both instances, both Virginia and Colorado had less than 16 polygons.  If these states contained more than 16 areas, the where clause would need to be redefined.

Part 4 Offline Area Python Script.png

Knowing that every utilities’ data model will be slightly different, multiple entries in the configuration file are used.  This gives the script flexibility to name the offline map areas using the fields in your data along with allowing the script to run in your Dev, Test & Production environments without making code changes.

Part 4 Offline Area Python Script 2.png

Another benefit of using the Python script is the log file.  This provides documentation as to when each offline map areas was created and the duration it took. 

Part 4 Offline Area Log File.png

Reporting on the Offline Map Areas

After setting up the configuration file and running the python script, 100 offline map areas in 13 web maps have been created.  A simple way to report on these offline map areas is now needed.  The log file has good information but wasn’t meant to be a report.  There is another attached python script that generates a CSV file containing details about web maps with offline map areas.  The CSV identifies the contents of each offline map area and the files sizes of every Vector Tile package and SQLite database.  Not only is this report useful for knowing what exists in your Portal but also show the amount of data to be downloaded to a mobile device.

Part 4 Offline Area Spreadsheet.png

What needs to occur if I need to change the web map?

Your Utility has been in production for a few months now and the Field workers are actively using the offline capabilities.  To be more efficient, they are asking for a couple of changes to the web map.    Specifically, a labeling change on a linear feature, a change to the order of attributes on a specific device and the need to capture a new attribute on a structure.

Making those changes the web map is easy enough but that won’t initiate the change to the offline map areas.  Once an offline map area is created, it’s schema and it’s corresponding web map is locked down.  New web maps need to be created to get these changes available to the field worker.

To apply schema or map changes, the workflow would be something like this:

  1. In Portal, existing web maps with offline map areas should be renamed and/or deleted
  2. Make the necessary schema changes (ex.  Add a field)
  3. Using ArcGIS Pro, update the “Master” web map in Portal with the labeling and pop-up configuration
  4. Make the necessary copies of the “Master” web map
  5. Re-run the Python script to create offline map areas
  6. Notify field users that existing offline map areas should be deleted from their device and that newly created offline map areas are available for download

As you can see, this python script not only helps with the initial creation and deployment of offline map areas, but it also streamlines the ongoing support and propagation of changes.

Simplifying a GIS Administrators Job

The recommendations in this blog are the real-world lessons we learned from assisting a large utility customer with deploying offline map areas. From creating the master web map to using the Python API to automate the creation of the offline map areas.  These learned lessons removed the GIS administrator cringe of doing time-consuming manual processes for the deployment, and instead provided an automated process allowing our servers to continue working while we went home.

If you are interested in using the python scripts described in this blog, they are available on Esri GitHub so that you don’t have to start coding from scratch.

About this Blog Series

This is the fourth blog in our series on offline map areas. In future blog articles we will continue to explain decisions an administrator will need to make during deployment.

The first blog provided and overview of offline map areas.

The second blog provided details on preparing your data for offline usage.

The third blog will provide details and options for publishing the selected data repositories.

The fifth and final blog will provide details on the deployment and management of offline map areas for a large mobile workforce.

PLEASE NOTE: The postings on this site are our own and don’t necessarily represent Esri’s position, strategies, or opinions.

 

About the Author
Technical Lead for Natural Gas Industry at Esri
Labels