Summary
Builds pyramids for multiple raster datasets.
Usage
Building pyramids improves the display performance of raster datasets.
Batch building of pyramids is useful when you have a large directory of raster datasets that do not have pyramids or to build pyramids on the items of a mosaic dataset (drag them into the dialog box).
Wavelet compressed raster datasets, such as ECW and MrSID, do not need to have pyramids built. These formats have internal pyramids that are created upon encoding.
Pyramids will not be built for raster datasets that have less than 1,024 pixels in the row or column. Pyramids are not needed since the raster dataset is small enough, and building pyramids will not help increase the performance.
You can choose the compression type for your overview pyramid file in the Raster Storage Environments. Compression will create a smaller .ovr file. The IMAGINE format and older versions of ArcGIS will create reduced-resolution dataset (.rrd) files, where compression is not available.
The default pyramid compression will use the optimal compression type, given the type of data. You can manually choose to have LZ77, JPEG, or no compression.
Syntax
arcpy.management.BatchBuildPyramids(Input_Raster_Datasets, {Pyramid_levels}, {Skip_first_level}, {Pyramid_resampling_technique}, {Pyramid_compression_type}, {Compression_quality}, {Skip_Existing})
Parameter | Explanation | Data Type |
Input_Raster_Datasets [input_raster_dataset,...] | The raster datasets for which you want to build raster pyramids. Each input should have more than 1024 rows and 1024 columns. | Raster Dataset |
Pyramid_levels (Optional) | Choose the number of reduced-resolution dataset layers that will be built. The default value is -1, which will build full pyramids. A value of 0 will result in no pyramid levels. | Long |
Skip_first_level (Optional) | Choose whether to skip the first pyramid level. Skipping the first level will take up slightly less disk space, but it will slow down performance at these scales.
| Boolean |
Pyramid_resampling_technique (Optional) | The resampling technique used to build your pyramids.
| String |
Pyramid_compression_type (Optional) | The compression type to use when building the raster pyramids.
| String |
Compression_quality (Optional) | The compression quality to use when pyramids are built with the JPEG compression method. The value must be between 0 and 100. The values closer to 100 will produce a higher-quality image, but the compression ratio will be lower. | Long |
Skip_Existing (Optional) | Specify whether to build pyramids only where they are missing or regenerate them even if they exist.
| Boolean |
Derived Output
Name | Explanation | Data Type |
Batch_Build_Pyramids_Succeeded | Returns whether the tool was successful. | Boolean |
Code sample
This is a Python sample for the BatchBuildPyramids tool.
import arcpy
arcpy.BatchBuildPyramids_management(
"C:/data/img1.tif;C:/data/img2.img", "6", "SKIP_FIRST",
"BILINEAR", "JPEG", "50", "SKIP_EXISTING")
This is a Python script sample for the BatchBuildPyramids tool.
#Build Pyramids for multiple raster datasets in the workspace
#Skip the dataset that already has pyramid
#Build pyramids with compression and level setting
import arcpy
arcpy.env.workspace = "C:/Workspace"
inras = "image1.tif;image2.img;fgdb.gdb/image3"
pylevels = "6"
skipfirst = "SKIP_FIRST"
resample = "BILINEAR"
compress = "JPEG"
quality = "80"
skipexist = "SKIP_EXISTING"
arcpy.BatchBuildPyramids_management(
inras, pylevels, skipfirst, resample, compress,
quality, skipexist)
Environments
- Pyramid
The pyramid level, pyramid compression, and resampling method does not apply to the IMG format.
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes