ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Manage Globe Server Cache Tiles

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

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.

Legacy:

This is a deprecated tool.

Legacy:
Parameters changed for this tool at version 10.1. Models and scripts written prior to 10.1 that use this tool must be modified to work in 10.1.

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

arcpy.server.ManageGlobeServerCacheTiles(service, in_layers, update_mode, {num_of_caching_service_instances}, {area_of_interest}, {ignore_status}, {update_extent})
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 the 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:

  • RECREATE_EMPTY_TILES —Only tiles that are empty will be created. Existing tiles will be left unchanged.
  • RECREATE_ALL_TILES —All 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 will be dedicated to running this tool. You can increase the Maximum number of instances per machine setting of the System/CachingTools service using the Service Editor window available through an administrative connection to ArcGIS Server. Ensure that 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_STATUS —The 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_STATUS —The feature class' Cached field is ignored and tiles are created for all features in the feature class.
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

  • Basic: Requires 3D Analyst
  • Standard: Requires 3D Analyst
  • Advanced: Requires 3D Analyst

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

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

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal