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
  • 我的个人资料
  • 登出

帮助

  • 主页
  • 入门
  • 制图
  • 分析
  • 管理数据
  • 工具
  • 更多...

管理 Globe 服务器缓存切片

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

摘要

在现有 Globe 服务缓存中创建和更新切片。此工具用于创建新切片、恢复缺失切片、覆盖过时切片或添加新切片。所有这些操作都可通过矩形范围或面要素类定义。创建新切片时,可选择是仅创建空切片还是重新创建所有切片。

旧版本:
在 10.1 版本中,此工具的各个参数都发生了变化。在 10.1 版本之前使用该工具编写的模型或脚本均需要经过修改才能在 10.1 版本中使用。

用法

  • 此工具应被用于更新现有 Globe 服务器缓存。要更新缓存,请指定托管 Globe 服务的 ArcGIS Server。此工具会自动列出该服务器上所有可用的 Globe 服务。

  • 如果运行更新时并未指定范围,则该服务的整个范围都将得到更新。

  • 指定输入图层的 level_from 和 level_to 时,请务必指定生成切片时要用到的全部细节层次。level_from 定义了数据缓存起始的最低细节层次。level_to 定义了希望数据缓存具有的最高分辨率。

语法

ManageGlobeServerCacheTiles_server (service, {update_extent}, in_layers, update_mode, {num_of_caching_service_instances}, {area_of_interest}, {ignore_status})
参数说明数据类型
service

待更新缓存切片所属的 globe 服务。

这是一个包含服务器和服务器信息的字符串。要查看构建此字符串的方法,请打开 ArcCatalog,选择“目录”树中的服务,并注意位置 工具条中的文本。然后将反斜线改为正斜线,例如,MYSERVER (admin)/Seattle.GlobeServer 上的 GIS Servers/arcgis。

String
update_extent
(可选)

创建或删除切片所参照的矩形范围,具体取决于 update_mode 参数的值。输入范围值或将现有的某一数据源作为一个范围值即可。

Extent
in_layers
[[layer, level_from, level_to],...]

要包含在缓存中的图层。

您需要为每个图层提供缓存开始时的细节层次 level_from 以及缓存结束时的细节层次 level_to。如果将最小细节层次和最大细节层次分别用作 level_from 和 level_to,将为图层建立完全缓存。

Value Table
update_mode

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

  • RECREATE_EMPTY_TILES —只重新创建空切片。现有切片将保持不变。
  • RECREATE_ALL_TILES —更换包括现有切片在内的所有切片。如果图层数据范围发生改变或新图层已添加到 Globe 服务并已在此工具中列出,则将额外添加新的切片。
String
num_of_caching_service_instances
(可选)

专用于运行该工具的系统/缓存工具服务实例的总数。您可以通过与 ArcGIS Server 的管理连接,使用 服务编辑器 窗口,增加系统/缓存工具服务的每台计算机的最大实例数。确保您的服务器计算机可以支持所选数量的实例。

Long
area_of_interest
(可选)

定义感兴趣区以对将创建或删除的切片进行约束。它可能是一个要素类,也可能是在 ArcMap 中以交互方式定义的要素。该参数用于为形状不规则的区域管理切片。它对您要对某些区域进行预缓存或让较少访问的区域保持未缓存的状态等情形也同样有用。

Feature Set
ignore_status
(可选)

如果您基于要素类边界创建切片,则可使用此参数追踪缓存的状态(请参阅 update_feature_class 参数)。

  • TRACK_STATUS —读取要素类的“已缓存”字段(如果此字段尚未存在,则创建此字段)。将对此字段中包含“否”或空值的要素进行缓存,在完成对要素的缓存后,此字段将包含“是”。将不对此字段中已标记为“是”的要素进行缓存。
  • DO_NOT_TRACK_STATUS —忽略要素类的“已缓存”字段,并为要素类中的所有要素都创建切片。
Boolean

代码示例

为 globe 服务创建缓存切片。

#ManageGlobeServerCacheTiles For ArcGIS Server 10.1 Beta example (stand-alone script)

# Name: ManageGlobeServerCacheTiles.py
# Description: The following stand-alone script demonstrates how to update the
#               globe map server cache tiles
# Requirements: os, sys, time & traceback modules 
# Author: ESRI

# Any line that begins with a pound sign is a comment and will not be executed
# Empty quotes take the default values
# To accept arguments from the command line replace values of variables to
#                                                           "sys.argv[]"

# Import system modules
import arcpy
from arcpy import env
import os, sys, time, datetime, traceback, string

# Set environment settings
env.workspace = "C:/data"

# List of input variables for map service properties
connectionFile = r"C:\Users\<username>\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog"
server = "arcgis on MyServer_6080 (publisher)"
globeServiceName = "tstGlobeService.GlobeService"
globeService = connectionFile + "\\" + server + "\\" + globeServiceName
inputLayers = ""
updateExtents = ""
updateMode = "RECREATE_ALL_TILES"
numOfCachingServiceInstances = "2"
areaOfInterest = ""
ignoreStatus = "DO_NOT_TRACK_STATUS"

currentTime = datetime.datetime.now()
arg1 = currentTime.strftime("%H-%M")
arg2 = currentTime.strftime("%Y-%m-%d %H:%M")
file = 'C:/data/report_%s.txt' % arg1

# print results of the script to a report
report = open(file,'w')

try:
    starttime= time.clock()
    result = arcpy.ManageGlobeServerCacheTiles_server (globeService, inputLayers,
                                                       updateMode,
                                                       numOfCachingServiceInstances,
                                                       areaOfInterest,
                                                       ignoreStatus, updateExtents)
    finishtime = time.clock()
    elapsedtime = finishtime - starttime

    #print messages to a file
    while result.status < 4:
        time.sleep(0.2)
    resultValue = result.getMessages()
    report.write ("completed " + str(resultValue))

    print "Created the GlobeServer cache successfully for mapservice "
    globeService + "\n in " + str(elapsedtime) + " sec \n on " + arg2

except Exception, e:
    # If an error occurred, print line number and error message
    tb = sys.exc_info()[2]
    report.write("Failed at step 1 \n" "Line %i" % tb.tb_lineno)
    report.write(e.message)
report.close()
    
print "Created the globe server cache successfully"

环境

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

许可信息

  • ArcGIS Desktop Basic: 需要 3D Analyst
  • ArcGIS Desktop Standard: 需要 3D Analyst
  • ArcGIS Desktop Advanced: 需要 3D Analyst

相关主题

  • 缓存工具集概述

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. | 隐私政策 | 法律声明