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.
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
UpdateMapServerCache_server (server_name, object_name, data_frame, layer, {constraining_extent}, levels, update_mode, {thread_count}, {antialiasing}, {update_feature_class}, {ignore_status})
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;layer... | Layers to remove from the cache. | String |
constraining_extent (Optional) | Extent in the cache to update. | Extent |
levels scale;scale... | A list of scale levels to update. | String |
update_mode | Choose a mode for updating the cache. The two modes are:
| 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 |
update_feature_class (Optional) | A polygon feature class used to derive the extents for which the cache should be updated. | Feature Class |
ignore_status (Optional) | Choose Cache all features and ignore completion status field to ignore the cache completion status field and cache all feature extents. Choose Track cache completion status for each feature option to update the cache completion status to a field named Cached. A status of "Yes" is written to the Cached field after successful completion of cache generation for that feature. | String |
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, 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)
Environments
This tool does not use any geoprocessing environments