Generate Tile Cache Tiling Scheme (Data Management)

License Level:BasicStandardAdvanced

Summary

This tool 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 also be used to edit the properties, such as tile format, storage format, tile size (and so on), of an existing tiling scheme. Except for an ArcGIS Online scheme, this tool does not generate a tilling scheme file that has a different spatial reference from an input source dataset.

Usage

Syntax

GenerateTileCacheTilingScheme_management (in_dataset, out_tiling_scheme, tiling_scheme_type, number_of_scales, {predefined_tiling_scheme}, {scales}, {scales_type}, {tile_origin}, {dpi}, {tile_size}, {tile_format}, {tile_compression_quality}, {storage_format})
ParameterExplanationData Type
in_dataset

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

File
out_tiling_scheme

Path and file to the output tiling scheme to be created.

File
tiling_scheme_type

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).

  • NEWYou will define 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 type.

File
scales
[scales,...]
(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)

Select to display pixel sizes or scale levels in the Scales parameter.

  • CELL_SIZEIndicates the values of the Scales parameter are pixel sizes.
  • 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, the scale of the tile will appear incorrect. The default value is 96.

Long
tile_size
(Optional)

The width of the cache tiles in pixels. The default is 256. For the best balance between performance and manageability, avoid deviating from standard widths of 256 or 512.

String
tile_format
(Optional)

Choose either PNG, PNG8, PNG24, PNG32, JPEG, or MIXED file format for the tiles in the cache. MIXED is the default.

  • PNGCreates PNG format with varying bit depths. The bit depths are optimized according to the color variation and transparency values in a 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 ArcMap. Versions of Internet Explorer less than version 7 do not support this type of transparency. Caches using PNG24 are significantly larger than those using PNG8 or JPEG and 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 and 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 PNG 32 anywhere that transparency is detected (in other words, anyplace where the data frame background is visible). 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.
String
tile_compression_quality
(Optional)

Enter a value between 1 and 100 for the JPEG or MIXED compression quality. The default value is 75 for JPEG and MIXED tile format and zero for other formats.

Compression is supported only for MIXED and JPEG format. Choosing a higher value will result in a larger file size with a higher-quality image. Choosing a lower value will result in a smaller file size with a lower-quality image.

Long
storage_format
(Optional)

Determines the storage format of tiles. The default storage format is COMPACT.

  • COMPACTGroup tiles into large files called bundles. This storage format is more efficient in terms of storage and mobility.
  • EXPLODEDStore each tile as a separate file.
String

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

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013