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 Desktop, in the <install location>\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_management (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})
Parameter | Explanation | Data 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. | ArcMap Document; Mosaic Layer; Raster Layer |
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).
| 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.
| 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.
| String |
tile_format (Optional) | The file format for the tiles in the cache.
| 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.
| 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
- ArcGIS Desktop Basic: Yes
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes