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_name, object_name, data_frame, Layer, {constraining_extent}, levels, update_mode, {thread_count}, {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 (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:
| 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
Name | Explanation | Data Type |
out_server_name | String | |
out_object_name | 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, 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