Manage Globe Server Cache Tiles (Server)
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.
-
Update is useful to run when you need to update only a portion of the globe service cache. When specifying level_from and level_to, 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
Parameter | Explanation | Data Type |
server_name |
The ArcGIS Server machine hosting the globe service whose tiles you are managing. | String |
object_name |
The globe service whose tiles will be modified. | String |
update_extent (Optional) |
Rectangular extent at which tiles should be created or deleted, depending on the Update Mode. You can type the extent values or choose an extent from an existing data source. | Extent |
in_layers [in_layers,...] |
Select 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 |
thread_count (Optional) |
Number of globe service instances to use while running this tool. By default the maximum allowable number of instances will be used (default for an ArcGIS Server service is 2) . If you have more server power, you can raise the maximum allowable number of instances in the Service Properties, then raise this parameter when you run the tool. | Long |
update_mode |
Choose a mode for updating the cache. The two modes are:
| String |
update_feature_class (Optional) |
You can use a polygon feature class to manage tiles (create/update) based on the extents of features in a feature class. For example, if you are caching a country, you might supply a feature class of major urban areas. By doing so, you are requesting that the server only pre-create tiles that cover those urban areas. The rest of the areas can be cached on demand when requested by clients. This can save you time and disk space that would be consumed by creating unneeded tiles in rural areas. | Feature Class |
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 |
Code Sample
This example creates a full cache for a globe service.
#ManageGlobeServerCacheTiles 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 server = "MyServer" globeServerObject = "tstGlobeService" inputLayers = "" extents = "" cacheDir = "C:\\arcgisserver\\arcgiscache\\GlobeCache" threadCount = "2" updateMode = "Recreate All Tiles" pathToFeatureClass = "" ignoreStatus = "IGNORE_COMPLETION_STATUS_FIELD" 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 (server, globeServerObject, extents, updateMode, inputLayers, threadCount, pathToFeatureClass, ignoreStatus) 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 " + globeServerObject + "\n at " + cacheDir + globeServerObject + " 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"