Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Server toolbox > Caching toolset > Tools

Update Map Server Cache (Server)

Release 9.2
Last modified November 22, 2006
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

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.


Usage tips

Command line syntax
An overview of the Command Line window
UpdateMapServerCache_Server <server_name> <object_name> <data_frame> <layer;layer...> {constraining_extent} <scale;scale...> <RECREATE_EMPTY_TILES| RECREATE_ALL_TILES> {thread_count} {NONE | ANTIALIASING}

Parameter Explanation Data 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}

Extent in the cache to update.

Extent
<scale;scale...>

A list of scale levels to update.

String
<RECREATE_EMPTY_TILES| RECREATE_ALL_TILES>

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.

Boolean
{thread_count}

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

Long
{NONE | ANTIALIASING}

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
Data types for geoprocessing tool parameters


Command line example

UpdateMapServerCache "myServer" "myMapService" "Layers" "Layer1;Layer2" "5.86 47.27 15.04 55.05" "8000000;4000000;2000000" "Recreate Empty Tiles" 2 Antialiasing

Scripting syntax
About getting started with writing geoprocessing scripts
UpdateMapServerCache_Server (server_name, object_name, data_frame, layer, constraining_extent, levels, update_mode, thread_count, antialiasing)

Parameter Explanation Data Type
server_name (Required)

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

String
object_name (Required)

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

String
data_frame (Required)

The map frame to cache.

String
layer (Required)

Layers to remove from the cache.

String
constraining_extent (Optional)

Extent in the cache to update.

Extent
levels (Required)

A list of scale levels to update.

String
update_mode (Required)

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.

Boolean
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

Data types for geoprocessing tool parameters


Script example

# 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, string, 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)

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.