Summary
Creates and updates tiles in an existing globe service cache. This tool is used to create new tiles or to replace missing tiles, overwrite outdated tiles, or add new tiles. All these actions can be defined by rectangular extents or by a polygon feature class. When creating new tiles, you can choose whether to create only empty tiles or re-create all tiles.
Usage
This tool should be used to update an existing globe server cache. To update a cache, specify the ArcGIS Server hosting the globe service. The tool will automatically list all globe services available on that server.
Running update without specifying an extent will update the entire extent of the service.
When specifying level_from and level_to for the input layers, make sure you specify all levels at which you want tiles generated. The level_from defines the lowest level of detail you want your data cache to begin with. The level_to defines the highest resolution you want your data caching to have.
Syntax
ManageGlobeServerCacheTiles_server (service, in_layers, update_mode, {num_of_caching_service_instances}, {area_of_interest}, {ignore_status}, {update_extent})
Parameter | Explanation | Data Type |
service | The globe service whose cache tiles you want to update. This is a string containing both the server and service information. To see how to construct this string, open ArcCatalog, select your service in the Catalog tree, and note the text in the Location toolbar. Change the backslashes to forward slashes, for example, GIS Servers/arcgis on MYSERVER (admin)/Seattle.GlobeServer. | GlobeServer |
in_layers [[layer, level_from, level_to],...] | The layers to include in the cache. For each layer, you need to provide a level_from, which is the level of detail at which you would like to begin caching the layer, and a level_to, which is the level of detail at which you would like to end caching the layer. If the smallest and largest levels of detail are used for level_from and level_to, respectively, a full cache will be built for the layer. | Value Table |
update_mode | Choose a mode for updating the cache. The two modes are:
| String |
num_of_caching_service_instances (Optional) |
The total number of instances of the System/CachingTools service that you want to dedicate toward running this tool. You can increase the maximum number of instances per machine of the System/CachingTools service using the Service Editor window available through an administrative connection to ArcGIS Server. Ensure your server machines can support the chosen number of instances. | Long |
area_of_interest (Optional) | Defines an area of interest to constrain where tiles will be created or deleted. This can be a feature class, or it can be a feature that you interactively define in ArcMap. This parameter is useful if you want to manage tiles for irregularly shaped areas. It's also useful in situations where you want to precache some areas and leave less-visited areas uncached. | Feature Set |
ignore_status (Optional) | This parameter allows you to track the status of your caching if you are creating tiles based on feature class boundaries (see the update_feature_class parameter).
| Boolean |
update_extent (Optional) | Rectangular extent at which tiles should be created or deleted, depending on the value of the update_mode parameter. You can type the extent values or choose an extent from an existing data source. | Extent |
Code sample
Creates cache tiles for a globe service.
#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"
Environments
This tool does not use any geoprocessing environments.
Licensing information
- ArcGIS Desktop Basic: Requires 3D Analyst
- ArcGIS Desktop Standard: Requires 3D Analyst
- ArcGIS Desktop Advanced: Requires 3D Analyst