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 Tile Cache

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

Summary

Creates a tile cache or updates tiles in an existing tile cache. You can use this tool to create tiles, replace missing tiles, overwrite outdated tiles, and delete tiles.

Usage

  • The Input Data Source parameter value can be a map; however, the document cannot contain a map service or an image service.

  • When creating a tile cache using this tool, if the Area of Interest parameter value is not specified, the cache will be created with the full extent of the raster or the current extent of the map document.

  • The extent of the generated cache may be larger than the Area of Interest parameter value. If this is the case, the tool divides the data into large areas, known as supertiles, before cutting it into tiles of the size specified. When the Input Data Source parameter value uses antialiasing, the supertile is 2,048 by 2,048 pixels; otherwise, it is 4,096 by 4,096. When the specified Area of Interest feature intersects the boundary of a supertile, that entire supertile will be created. This means that you may need to zoom in before caching by a feature class can have an effect in saving time or disk space. If you have multiple areas of interest and they cover most of the Input Data Source parameter value, you may not get much benefit from caching by a feature class, because most of the features will intersect a supertile.

  • To create cache in a custom tiling scheme, ensure that you have a tiling scheme defined for the source dataset before using this tool. You can use the Generate Tile Cache Tiling Scheme tool to create the tiling scheme.

  • To create a cache in an ArcGIS Online tiling scheme, specify ARCGISONLINE_SCHEME for the Input Tiling Scheme parameter.

  • This tool may take a long time to run for caches that cover a large geographic extent or very large scales. If the tool is canceled, tile creation is stopped, but the existing tiles are not deleted. This means that you can cancel the tool at any time, and if you rerun it later on the same cache and specify RECREATE_EMPTY_TILES for the Manage Mode parameter, it will continue from where it left off.

  • This tool supports the Parallel Processing environment setting.

Syntax

arcpy.management.ManageTileCache(in_cache_location, manage_mode, {in_cache_name}, {in_datasource}, {tiling_scheme}, {import_tiling_scheme}, {scales}, {area_of_interest}, {max_cell_size}, {min_cached_scale}, {max_cached_scale})
ParameterExplanationData Type
in_cache_location

The folder in which the cache dataset is created, the raster layer, or the path to an existing tile cache.

Folder; Raster Layer
manage_mode

Specifies the mode that will be used to manage the cache.

  • RECREATE_ALL_TILES —Existing tiles will be replaced and new tiles will be added if the extent has changed or if layers have been added to a multilayer cache.
  • RECREATE_EMPTY_TILES —Only tiles that are empty will be created. Existing tiles will be left unchanged.
  • DELETE_TILES —Tiles will be deleted from the cache. The cache folder structure will not be deleted.
String
in_cache_name
(Optional)

The name of the cache dataset to be created in the cache location.

String
in_datasource
(Optional)

A raster dataset, mosaic dataset, or a map document.

This parameter is not required when DELETE_TILES is specified for the manage_mode parameter.

An ArcMap document (.mxd) cannot contain a map service or image service.

ArcMap Document; Mosaic Layer; Raster Layer
tiling_scheme
(Optional)

Specifies the tiling scheme that will be used.

  • ARCGISONLINE_SCHEME —The default ArcGIS Online tiling scheme will be used.
  • IMPORT_SCHEME —An existing tiling scheme will be imported and used.
  • ARCGISONLINE_ELEVATION_SCHEME —The elevation services tiling scheme will be used.
  • WGS84_V2_SCHEME —The WGS84 version 2 tiling scheme will be used.
String
import_tiling_scheme
(Optional)

The path to an existing scheme file (.xml) or to a tiling scheme imported from an existing image service or map service.

Image Service; Map Server; File
scales
[scale,...]
(Optional)

The scale levels at which tiles will be created or deleted , depending on the value of the manage_mode parameter. The pixel size is based on the spatial reference of the tiling scheme.

  • By default, only the values for min_cached_scale and max_cached_scale will be used when generating cache.
  • Altering the value of either the min_cached_scale or the max_cached_scale parameter will change which scales will be used when generating cache.
  • Scales that exist but are not within the range of the min_cached_scale or max_cached_scale parameter values will be ignored when generating the cache.
Double
area_of_interest
(Optional)

Defines an area of interest to constrain where tiles will be created or deleted.

It can be a feature class, or it can be a feature set that you interactively define.

This parameter is useful if you want to manage tiles for irregularly shaped areas. It's also useful when you want to precache some areas and leave less-visited areas uncached.

Feature Set
max_cell_size
(Optional)

The value that defines the visibility of the data source for which the cache will be generated. By default, the value is empty.

If the value is empty, the following apply:

  • For levels of cache that lie within the visibility ranges of the data source, the cache will be generated from the data source.
  • For levels of cache that fall outside the visibility of the data source, the cache will be generated from the previous level of cache.

If the value is greater than zero, the following apply:

  • For levels with cell sizes smaller than or equal to the Maximum Source Cell Size (max_cell_size) value, the cache will be generated from the data source.
  • For levels with cell sizes greater than the Maximum Source Cell Size (max_cell_size) value, the cache will be generated from the previous level of cache.

The unit of the Maximum Source Cell Size value should be the same as the unit of the cell size of the source dataset.

Double
min_cached_scale
(Optional)

The minimum scale at which tiles will be created. This value does not have to be the smallest scale in the tiling scheme. The minimum cache scale will determine which scales are used when generating cache.

Double
max_cached_scale
(Optional)

The maximum scale at which tiles will be created. This does not have to be the largest scale in the tiling scheme. The maximum cache scale will determine which scales are used when generating cache.

Double

Derived Output

NameExplanationData Type
out_cache_location

The cache dataset to create in the output cache location.

Raster Dataset

Code sample

ManageTileCache example 1 (Python window)

This is a Python sample for the ManageTileCache tool.

import arcpy
            
arcpy.ManageTileCache_management(
      "C:/CacheDatasets/Manage", "RECREATE_ALL_TILES", "Test",
      "C:/Data/Cache.gdb/Md", "IMPORT_SCHEME", "C:/Data/Cache.gdb/Md",
      "#", "#", "#", "40000", "2000")
ManageTileCache example 2 (stand-alone script)

This is a Python script sample for the ManageTileCache tool.

#Generate tile cache for 3 out of 5 levels defined in tiling scheme

import arcpy

folder = "C:/Workspace/CacheDatasets/Manage"
mode = "RECREATE_ALL_TILES"
cacheName = "Test"
dataSource = "C:/Workspace/Cache.gdb/md"
method = "IMPORT_SCHEME"
tilingScheme = "C:/Workspace/Schemes/Tilingscheme.xml"
scales = "16000;8000;4000;2000;1000"
areaofinterest = "#"
maxcellsize = "#"
mincachedscale = "8000"
maxcachedscale = "2000"

arcpy.ManageTileCache_management(
       folder, mode, cacheName, dataSource, method, tilingScheme,
       scales, areaofinterest, maxcellsize, mincachedscale, maxcachedscale)

Environments

  • Parallel Processing Factor
    Note:

    If the Parallel Processing Factor value is empty (blank), the tool will run with a default value of 50 percent (one-half) of the available cores.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics

  • An overview of the Tile Cache toolset

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