摘要
更新现有地图服务缓存以恢复缺失的切片、覆盖过期的切片或在新区域中添加新切片(如果是多图层缓存,则添加附加图层中的切片)。
用法
使用“重新创建空切片”模式在先前未进行缓存的范围中添加切片。
使用“重新创建所有切片”模式更新过期的切片。
运行此工具之前,先配置地图服务以使用尽可能多的实例。这会大大缩短缓存的更新时间。
此工具不接受任何已指定的环境设置。
语法
UpdateMapServerCache_server (server_name, object_name, data_frame, Layer, {constraining_extent}, levels, update_mode, {thread_count}, {Antialiasing})| 参数 | 说明 | 数据类型 | 
server_name  | 更新缓存时所使用的 ArcGIS Server 的主机名。  | String | 
object_name  | 更新缓存时所使用的地图服务的名称。  | String | 
data_frame  | 要进行缓存的地图框。  | String | 
Layer [Layer,...]  | 要从缓存中删除的图层。  | String | 
constraining_extent (可选)  | 缓存中要更新的范围。  | Extent | 
levels [levels,...]  | 一系列要更新的比例级别。  | Double | 
update_mode  | 选择缓存的更新模式。有两种模式可用: 
  | String | 
thread_count (可选)  | 更新缓存时要使用的地图服务实例的数量。  | Long | 
Antialiasing (可选)  | 选择是否在渲染切片时使用抗锯齿功能。如果选择了 ANTIALIASING,则会对线、边框和文字的边缘进行平滑处理。此选项会带来性能开销。栅格数据不会获得任何益处。  | Boolean | 
代码示例
# 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)
环境
此工具不使用任何地理处理环境。
许可信息
- ArcGIS Desktop Basic: 是
 - ArcGIS Desktop Standard: 是
 - ArcGIS Desktop Advanced: 是