ArcGIS Desktop

  • 文档
  • 支持

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS for Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

更新地图服务器缓存

  • 摘要
  • 用法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

摘要

更新现有地图服务缓存以恢复缺失的切片、覆盖过期的切片或在新区域中添加新切片(如果是多图层缓存,则添加附加图层中的切片)。

旧版本:

此工具已被弃用。请改为使用“管理地图服务器缓存切片”。

用法

  • 使用“重新创建空切片”模式在先前未进行缓存的范围中添加切片。

  • 使用“重新创建所有切片”模式更新过期的切片。

  • 运行此工具之前,先配置地图服务以使用尽可能多的实例。这会大大缩短缓存更新时间。

  • 此工具不接受任何已指定的环境设置。

语法

UpdateMapServerCache_server (server_name, object_name, data_frame, layer, {constraining_extent}, levels, update_mode, {thread_count}, {antialiasing}, {update_feature_class}, {ignore_status})
参数说明数据类型
server_name

更新缓存时所使用的 ArcGIS Server 的主机名。

String
object_name

更新缓存时所使用的地图服务的名称。

String
data_frame

要进行缓存的地图框。

String
layer
layer;layer...

要从缓存中删除的图层。

String
constraining_extent
(可选)

缓存中要更新的范围。

Extent
levels
scale;scale...

一系列要更新的比例级别。

String
update_mode

选择缓存的更新模式。有两种模式可用:

  • 重新创建空切片 - 只有空切片(已从磁盘上删除)或由于缓存范围发生改变或已将新图层添加到多图层缓存而产生的新切片需要重新创建。原有切片将保持不变。 —缺失值
  • 重新创建所有切片 - 如果范围发生改变或已将图层添加到多图层缓存,则更换所有切片并添加新切片。 —缺失值
Boolean
thread_count
(可选)

更新缓存时要使用的地图服务实例的数量。

Long
antialiasing
(可选)

选择是否在渲染切片时使用抗锯齿功能。如果选择了 ANTIALIASING,则会对线、边框和文字的边缘进行平滑处理。此选项会带来性能开销。对于栅格数据不会产生任何有利影响。

Boolean
update_feature_class
(可选)

用于推导要更新缓存的范围时的面要素类。

Feature Class
ignore_status
(可选)

选择“缓存所有要素并忽略完成状态字段”可忽略缓存完成状态字段并对所有要素范围都进行缓存。选择“追踪每个要素的缓存完成状态”选项可将缓存完成状态更新为“已缓存”字段。在成功生成该要素的缓存后,会将状态“是”写入“已缓存”字段。

String

代码示例

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

环境

此工具不使用任何地理处理环境

相关主题

  • 缓存工具集概述

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS 平台

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • 内部人员博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
© Copyright 2016 Environmental Systems Research Institute, Inc. | 隐私政策 | 法律声明