Generate Tile Cache Tiling Scheme (Data Management)
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
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 for Desktop (example: C:\Program Files\ArcGIS\Desktop10.1\TilingSchemes).
- Load a tiling scheme from an existing image service or map service cache.
- Load your own tiling scheme created using this tool (Generate Tile Cache Tiling Scheme).
Syntax
Parameter | Explanation | Data 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).
| 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.
| 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.
| 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.
| String |
Code Sample
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")
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)