ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Update Map Server Cache

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Updates an existing Map Service cache to replace missing tiles, overwrite outdated tiles, or add new tiles in new areas or, in the case of a multi-layer cache, from additional layers.

Legacy:

This is a deprecated tool. Use Manage Map Server Cache Tiles instead.

Usage

  • Use Recreate Empty Tiles mode to add tiles in an extent not previously cached.

  • Use Recreate All Tiles to update outdated tiles.

  • Before running this tool, configure the Map Service to use as many instances as possible. This will dramatically decrease cache update time.

  • This tool does not accept any Environment Setting that have been specified.

Syntax

arcpy.server.UpdateMapServerCache(server_name, object_name, data_frame, Layer, {constraining_extent}, levels, update_mode, {thread_count}, {Antialiasing})
ParameterExplanationData Type
server_name

The host name of the ArcGIS Server to use to update the cache.

String
object_name

The name of the Map Service to use to update the cache.

String
data_frame

The map frame to cache.

String
Layer
[Layer,...]

Layers to remove from the cache.

String
constraining_extent
(Optional)

Extent in the cache to update.

Extent
levels
[levels,...]

A list of scale levels to update.

Double
update_mode

Choose a mode for updating the cache. The two modes are:

  • Recreate Empty Tiles —Only tiles that are empty (have been deleted on disk), or that are new because the cache extent has changed or because new layers have been added to a multi-layer cache, will be created. Old tiles will be left unchanged.
  • Recreate All Tiles —All tiles will be replaced and new tiles will be added if the extent has changed or if layers have been added to a multi-layer cache.
String
thread_count
(Optional)

Number of Map Server instances to use while updating the cache.

Long
Antialiasing
(Optional)

Choose whether to use antialiasing when rendering the tiles. If ANTIALIASING is edges of lines, borders, and text will be smoothed. There is a performance cost for this option. No benefit will be gained on raster data.

Boolean

Derived Output

NameExplanationData Type
out_server_name

String
out_object_nameString

Code sample

# Script Name: Update Fused Map Server Cache
# Description: Updates a fused map server cache
# Uncomment sys.argv[] lines to accept arguments from the command line.
 
# Import standard library modules
import sys, os, arcgisscripting
 
# Create the Geoprocessor object
gp = arcgisscripting.create()
 
# Set the SOM server name
# Example: "mySOM"
server_name = "mySOM"
#server_name = sys.argv[1]
 
# Set the object_name
# Example: "MyServiceFolder/MyService"
object_name = "MyServiceFolder/MyService"
#object_name = sys.argv[2]
 
# Set the data frame
# Example: "Layers"
data_frame = "Layers"
#data_frame = sys.argv[3]
 
# Set the layers to cache.
# Example: "My First Layer;My Second Layer;My Third Layer"
layers = "My First Layer;My Second Layer;My Third Layer"
#layers = sys.argv[4]
 
# Set the extent to update in the cache.
# Example: "8 50 10 52"
constraining_extent = "8 50 10 52"
#constraining_extent = sys.argv[5]
 
# Set the scale levels for the cache.
# Example: "2000000;500000;250000"
scales = "2000000;500000;250000"
#scales = sys.argv[6]
 
# Set the update mode.
# Example: "Recreate Empty Tiles"
update_mode = "Recreate All Tiles"
#update_mode = sys.argv[7]
 
# Set number of instances to use while updating the cache
# Example: "3"
thread_count = "3"
#thread_count = sys.argv[8]
 
# Set antialiasing mode
# Example: "NONE"
antialiasing = "ANTIALIASING"
#antialiasing = sys.argv[9]
 
try:
    print 'Starting Cache Update'
    gp.UpdateMapServerCache(server_name, object_name, data_frame, layers, constraining_extent,  scales, update_mode, thread_count, antialiasing)
    print 'Finished Cache Update'
 
except:
    gp.AddMessage(gp.GetMessages(2))
    print gp.GetMessages(2)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics

  • An overview of the Caching toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal