ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

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

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

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

ArcGIS Solutions

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

ArcGIS Marketplace

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

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

ArcMap

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

删除 Globe 服务器缓存

  • 描述
  • 使用方法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

描述

删除现有 globe 服务缓存中的一个或多个图层及其包含的所有切片。

旧版本:

此工具已弃用。

使用方法

    旧版本:
    在 10.1 版本中,此工具的各个参数均发生了变化。 在 10.1 版本之前使用该工具编写的模型或脚本均必须经过修改才能在 10.1 版本中使用。
  • 由于这是一种不可恢复的操作,因此只有确定不再使用缓存时,方可执行此项操作。

  • 此工具可用于删除现有 globe 服务器缓存。要删除缓存,需指定 ArcGIS Server(主机)计算机并选择 globe 服务。图层列表即为所选服务中的所有可用图层。

  • 默认情况下,将显示并选中服务的所有图层。如果只打算删除特定图层的缓存,请确保取消选中需要保存缓存的那些图层。

  • 删除 Globe 服务器缓存用于删除整个缓存文件夹。请注意,在删除 Globe 服务器缓存工具运行后,将重新启动服务。这样将依次为删除操作所删除的服务中的每个图层生成一组新缓存。之所以这样做,是因为所有 globe 服务都需要 在磁盘中保留一份缓存配置。启动服务时自动创建的缓存是不包含任何切片的框架表达。

语法

arcpy.server.DeleteGlobeServerCache(service, Layer)
参数说明数据类型
service

待删除的图层缓存所属的 globe 服务。

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

GlobeServer
Layer
[Layer,...]

要删除缓存的 globe 服务中的图层。默认情况下将包含服务的所有图层。如果有一个图层未包含在内,则不会删除该图层的缓存。

String

代码示例

在本例中,将删除 globe 服务缓存的所有图层。

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

# Name: DeleteGlobeServerCache.py
# Description: The following stand-alone script deletes globe server cache
# 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 value.
# 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 = ""

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.DeleteGlobeServerCache_server(globeService, inputLayers)
    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 "Deleted the GlobeServer cache successfully for globeservice "
    globeServiceName + "\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 \n" "Line %i" % tb.tb_lineno)
    report.write(e.message)
report.close()
    
print "Deleted the globe server cache successfully"

环境

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

许可信息

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

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2021 Esri. | 隐私政策 | 法律声明