Generate Tile Cache Tiling Scheme (Data Management)

Summary

Creates a tiling scheme file based on the information from the source dataset. The tiling scheme file will then be used in the Manage Tile Cache tool when creating cache tiles.

This tool can be used to edit the properties of an existing tiling scheme, such as tile format, storage format, tile size, and so on. In addition, you can also use it to add new scale levels to an existing tiling scheme.

Usage

  • By default, the tiling origin starts at the upper left of the coordinate system used by the source dataset.

  • There are several options for loading an existing tiling scheme.

    • Load a tiling scheme from an online mapping service such as ArcGIS Online, Google Maps, Bing Maps, or Yahoo. These tiling schemes are located in the installation directory of ArcGIS Pro, in the <install>/resources/TilingSchemes folder.
    • Load a tiling scheme from an existing image service or map service cache.
    • Load a tiling scheme that you created in a previous run of this tool.

Syntax

GenerateTileCacheTilingScheme(in_dataset, out_tiling_scheme, tiling_scheme_generation_method, number_of_scales, {predefined_tiling_scheme}, {scales}, {scales_type}, {tile_origin}, {dpi}, {tile_size}, {tile_format}, {tile_compression_quality}, {storage_format}, {lerc_error})
ParameterExplanationData Type
in_dataset

The source to be used to generate the tiling scheme. It can be a raster dataset, a mosaic dataset, or a map.

Raster Layer; Mosaic Layer; Map
out_tiling_scheme

The path and file name for the output tiling scheme to be created.

File
tiling_scheme_generation_method

Choose to use a new or predefined tiling scheme. You can define a new tiling scheme with this tool or browse to a predefined tiling scheme file (.xml).

  • NEWDefine a new tiling scheme using other parameters in this tool to define scale levels, image format, storage format, and so on. This is the default.
  • PREDEFINEDUse a tiling scheme .xml file that already exists on disk.
String
number_of_scales

The number of scale levels to be created in the tiling scheme.

Long
predefined_tiling_scheme
(Optional)

Path to a predefined tiling scheme file (usually named conf.xml). This parameter is enabled only when the Predefined option is chosen as the tiling scheme generation method.

File
scales
[scale,...]
(Optional)

Scale levels to be included in the tiling scheme. By default, these are not represented as fractions. Instead, use 500 to represent a scale of 1:500, and so on. The value entered in the Number of Scales parameter generates a set of default scale levels.

Value Table
scales_type
(Optional)

Determines the units of the scales parameter.

  • CELL_SIZEIndicates the values of the scales parameter are pixel sizes. This is the default.
  • SCALEIndicates the values of the scales parameter are scale levels.
Boolean
tile_origin
(Optional)

The origin (upper left corner) of the tiling scheme in the coordinates of the spatial reference of the source dataset. The extent of the source dataset must be within (but does not need to coincide) this region.

Point
dpi
(Optional)

The dots per inch of the intended output device. If a DPI is chosen that does not match the resolution of the output device, typically a display monitor, the scale of the tile will appear incorrect. The default value is 96.

Long
tile_size
(Optional)

The width and height of the cache tiles in pixels. The default is 256 by 256.

For the best balance between performance and manageability, avoid deviating from widths of 256 or 512.

  • 128 x 128Tile width and height of 128 pixels.
  • 256 x 256Tile width and height of 256 pixels.
  • 512 x 512Tile width and height of 512 pixels.
  • 1024 x 1024Tile width and height of 1024 pixels.
String
tile_format
(Optional)

The file format for the tiles in the cache.

  • PNGCreates PNG format with varying bit depths. The bit depths are optimized according to the color variation and transparency values in each tile.
  • PNG8A lossless, 8-bit color, image format that uses an indexed color palette and an alpha table. Each pixel stores a value (0 to 255) that is used to look up the color in the color palette and the transparency in the alpha table. 8-bit PNGs are similar to GIF images and provide the best support for a transparent background by most web browsers.
  • PNG24A lossless, three-channel image format that supports large color variations (16 million colors) and has limited support for transparency. Each pixel contains three 8-bit color channels, and the file header contains the single color that represents the transparent background. The color representing the transparent background color can be set in the application. Versions of Internet Explorer prior to version 7 do not support this type of transparency. Caches using PNG24 are significantly larger than those using PNG8 or JPEG, so will take more disk space and require greater bandwidth to serve clients.
  • PNG32A lossless, four-channel image format that supports large color variations (16 million colors) and transparency. Each pixel contains three 8-bit color channels and one 8-bit alpha channel that represents the level of transparency for each pixel. While the PNG32 format allows for partially transparent pixels in the range from 0 to 255, the ArcGIS Server cache generation tool only writes fully transparent (0) or fully opaque (255) values in the transparency channel. Caches using PNG32 are significantly larger than the other supported formats, so will take more disk space and require greater bandwidth to serve clients.
  • JPEGA lossy, three-channel image format that supports large color variations (16 million colors) but does not support transparency. Each pixel contains three 8-bit color channels. Caches using JPEG provide control over output quality and size.
  • MIXEDCreates PNG32 anywhere that transparency is detected (in other words, anyplace where the data frame background is visible), but creates JPEG for the remaining tiles. This keeps the average file size down while providing you with a clean overlay on top of other caches. This is the default.
  • LERCLimited Error Raster Compression (LERC) is an efficient lossy compression method recommended for single-band or elevation data with a large pixel depth (12 bit to 32 bit). Compresses between 10:1 and 20:1.
String
tile_compression_quality
(Optional)

Enter a value between 1 and 100 for the JPEG or Mixed compression quality. The default value is 75.

Compression is supported only for Mixed and JPEG format. Choosing a higher value will result in higher-quality images, but the file sizes will be larger. Using a lower value will result in lower-quality images with smaller file sizes.

Long
storage_format
(Optional)

Determines the storage format of tiles.

  • COMPACTGroup tiles into large files called bundles. This storage format is more efficient in terms of storage and mobility. This is the default.
  • EXPLODEDEach tile is stored as an individual file.Note that this format cannot be used with tile packages.
String
lerc_error
(Optional)

Set the maximum tolerance in pixel values when compressing with LERC.

Double

Code sample

GenerateTileCacheTilingScheme example 1 (Python window)

This is a Python sample for the GenerateTileCacheTilingScheme tool.

import arcpy

arcpy.GenerateTileCacheTilingScheme_management(
     "C:/Data/Cache.gdb/Md","C:/TilingSchemes/scheme.xml",
     "NEW","8","#","#","#","#","96","256 x 256","MIXED",
     "75","COMPACT")
GenerateTileCacheTilingScheme example 2 (stand-alone script)

This is a Python script sample for the GenerateTileCacheTilingScheme tool.

#Generate tiling scheme for a mosaic dataset
#Generate 5 default scales



import arcpy
arcpy.env.workspace = "C:/Workspace"

mdname = "C:/Workspace/Cache.gdb/md"
outScheme = "C:/Workspace/Schemes/Tilingscheme.xml"
method = "NEW"
numscales = "5"
predefScheme = "#"
scales = "#"
scaleType = "SCALE"
tileOrigin = "-20037700 30198300"
dpi = "96"
tileSize ="256 x 256"
tileFormat = "MIXED"
compQuality = "75"
storageFormat = "COMPACT"

arcpy.GenerateTileCacheTilingScheme_management(
     mdName, outScheme, method, numscales, predefScheme, scales,
     scaleType, tileOrigin, dpi, tileSize, compQuality, storageFormat)

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics