Pyramid (Environment setting)

Tools that honor the Pyramid environment will only process rasters where the pyramids are valid. Pyramids for ERDAS IMAGINE files have limited options that can be set.

Pyramids are reduced-resolution representations of your dataset and are used to improve performance. Pyramids can speed up display of raster data by retrieving only the data at a specified resolution required for the display. Pyramids are created by resampling the original data. The resampling methods instruct the server on how to resample the data to build the pyramids.

Usage notes

  • The pyramid level refers to the number of reduced-resolution datasets (pyramid layers) that will be created when pyramids are built. The default is to leave the text box empty so that ArcGIS will choose the most appropriate level of pyramids (highly recommended). A value of -1 will give the same result as leaving the text box empty. A value of 0 will result in no pyramid levels. The maximum number of pyramid levels that can be specified is 29.
  • See the Raster Storage Matrix to find out which raster storage formats can be controlled when building pyramids.
  • Use NEAREST for nominal data or raster datasets with colormaps, such as land-use data, scanned maps, and pseudocolor images.
  • Use BILINEAR or CUBIC for continuous data, such as satellite imagery or aerial photography.
  • Not building pyramids saves storage space but will lead to slower display speed, especially for a larger raster dataset.
  • Skipping the first pyramid level will reduce the size of the pyramids. However, the trade-off is that it will be slower at the small-scale resolutions—this is often recommended to save space because the first pyramid level can be large.
  • JPEG compression is not supported by all pixel types; therefore, the default compression of LZ77 will be applied when necessary.
  • Pyramid compression will be ignored for geodatabase raster datasets because the pyramids will use the same compression as the raster dataset.

Dialog syntax

  • Build pyramids—Check this box to build pyramids for your raster.
  • Pyramid levels—Specify the number of pyramid levels. You can specify the number of levels to create, or you can leave the value blank to build all levels.
  • Skip first—Check this box to skip the first pyramid level for your raster.
  • Pyramid resampling technique—The resampling technique used to build your pyramids.
    • NEAREST—The nearest neighbor resampling method uses the value of the closest cell to assign a value to the output cell when resampling. This is the default.
    • BILINEAR—The bilinear interpolation resampling method determines the new value of a cell based on a weighted distance average of the four nearest input cell centers.
    • CUBIC—The Cubic convolution resampling method determines the new value of a cell based on fitting a smooth curve through the 16 nearest input cell centers.
  • Pyramid compression type—The compression type to use when building the raster pyramids.
    • DEFAULT—If the source data is compressed using a wavelet compression, it will build pyramids with the JPEG compression type; otherwise, LZ77 will be used. This is the default compression method.
    • LZ77—The LZ77 compression algorithm will be used to build the pyramids. LZ77 can be used for any data type.
    • JPEG—The JPEG compression algorithm to build pyramids. Only data that adheres to the JPEG compression specification can use this compression type. If JPEG is chosen, you can then set the compression quality.
    • JPEG_YCbCr—A lossy compression using the luma (Y) and chroma (Cb and Cr) color space components.
    • NONE—No compression will be used when building pyramids.
  • Compression Quality (1–100)—The compression quality to use when pyramids are built with the JPEG compression method.

Scripting syntax

arcpy.env.pyramid = "pyramid_option {levels} {interpolation_type} {pyramid_compression} {compression_quality} {skip_first}"

ParametersExplanation

pyramid_option (Required)

Specify if pyramids will be built.

  • PYRAMIDS—Pyramids will be built with the level that is chosen. This is the default. A level of -1 will build all pyramid levels.
  • NONE—Pyramids will not be built.

levels (Optional)

Determines how many reduced-resolution dataset layers will be built; the default value is –1, which instructs the server to build full pyramids, and the level is calculated by the server. A value of 0 will result in no pyramid levels. The maximum number of pyramid levels you can specify is 29. Any value that is 30 or higher will revert to a value of -1, which will create a full set of pyramids.

interpolation_type (Optional)

The following resampling techniques are used:

  • NEAREST neighbor—Uses the value of the closest cell to assign a value to the output cell when resampling. This is the default.
  • BILINEAR interpolation—Determines the new value of a cell based on a weighted distance average of the four nearest input cell centers.
  • CUBIC convolution—Determines the new value of a cell based on fitting a smooth curve through the 16 nearest input cell centers.

pyramid_compression (Optional)

The following compression types are used when building the raster pyramids:

  • DEFAULT—If the source data is compressed using a wavelet compression, it will build pyramids with the JPEG compression type; otherwise, LZ77 will be used. This is the default compression method.
  • LZ77—Uses the LZ77 compression type to build the pyramids. LZ77 can be used for any data type.
  • JPEG—Uses the JPEG compression algorithm to build pyramids. Only data that adheres to the JPEG compression specification can use this compression type.
  • JPEG_YCbCr—Uses a lossy compression with the luma (Y) and chroma (Cb and Cr) color space components.
  • NONE—No compression will be used when building pyramids.

compression_quality (Optional)

The compression quality to use when pyramids are built with the JPEG compression method.

skip_first (Optional)

  • NO_SKIP—All pyramids levels will be built. This is the default.
  • SKIP_FIRST—The first pyramid level will not be built.
pyramid syntax

Script example

import arcpy

# Set the pyramid environment to build all pyramids levels with cubic 
# convolution resampling, LZ77 compression
arcpy.env.pyramid = "PYRAMIDS -1 CUBIC LZ77 NO_SKIP"