Manage Globe Server Cache Tiles (Server)

License Level:BasicStandardAdvanced

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.

LegacyLegacy:
Parameters have changed for this tool at version 10.1. Models and scripts written prior to 10.1 that use this tool will need to be modified to work in 10.1.

Usage

Syntax

ManageGlobeServerCacheTiles_server (service, {update_extent}, in_layers, update_mode, {num_of_caching_service_instances}, {area_of_interest}, {ignore_status})
ParameterExplanationData 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. Then change the backslashes to forward slashes, for example, GIS Servers/arcgis on MYSERVER (admin)/Seattle.GlobeServer.

String
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
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:

  • RECREATE_EMPTY_TILESOnly tiles that are empty will be created. Existing tiles will be left unchanged.
  • RECREATE_ALL_TILESAll tiles, including existing tiles, will be replaced. Additionally, new tiles will be added if a layer's data extent has changed or new layers have been added to the globe service and listed in this tool.
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).

  • TRACK_STATUSThe feature class' Cached field is read (and created if it doesn't exist yet). Features containing No or null in this field are cached and will contain Yes when caching has completed for the feature. Features already marked Yes in this field are not cached.
  • DO_NOT_TRACK_STATUSThe feature class' Cached field is ignored and tiles are created for all features in the feature class.
Boolean

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

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires 3D Analyst
ArcGIS for Desktop Standard: Requires 3D Analyst
ArcGIS for Desktop Advanced: Requires 3D Analyst
1/21/2015