ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Build Pyramids And Statistics

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Traverses a folder structure, building pyramids and calculating statistics for all the raster datasets it contains. It can also build pyramids and calculate statistics for all the items in a mosaic dataset.

Usage

  • Building pyramids improves the display performance of raster datasets

  • Calculating statistics allows ArcGIS applications to properly stretch and symbolize raster data for display.

  • All supported raster formats will be processed.

  • Raster catalogs and mosaic datasets must be specified as the input workspace. If the workspace includes a raster catalog or mosaic dataset, then these items will not be included when the tool runs.

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

Syntax

BuildPyramidsAndStatistics_management (in_workspace, {include_subdirectories}, {build_pyramids}, {calculate_statistics}, {BUILD_ON_SOURCE}, {block_field}, {estimate_statistics}, {x_skip_factor}, {y_skip_factor}, {ignore_values}, {pyramid_level}, {SKIP_FIRST}, {resample_technique}, {compression_type}, {compression_quality}, {skip_existing})
ParameterExplanationData Type
in_workspace

The workspace that contains all the raster datasets to be processed, a mosaic dataset or a raster catalog.

If the workspace includes a raster catalog or mosaic dataset, then these items will not be included when the tool runs.

Mosaic Dataset; Mosaic Layer; Raster Catalog Layer; Raster Dataset; Text File; Workspace
include_subdirectories
(Optional)

Specify whether to include subdirectories.

  • NONE —Does not include subdirectories.
  • INCLUDE_SUBDIRECTORIES —Includes all the raster datasets within the subdirectories when loading. This is the default.

Raster catalogs and mosaic datasets must be specified as the input workspace. If the workspace includes a raster catalog or mosaic dataset, then these items will not be included when the tool runs.

Boolean
build_pyramids
(Optional)

Specify whether to build pyramids.

  • NONE —Does not build pyramids.
  • BUILD_PYRAMIDS —Builds pyramids. This is the default.
Boolean
calculate_statistics
(Optional)

Specify whether to calculate statistics.

  • NONE —Does not calculate statistics.
  • CALCULATE_STATISTICS —Calculates statistics. This is the default.
Boolean
BUILD_ON_SOURCE
(Optional)

Specify whether to build pyramids and calculate statistics on the source raster datasets or calculate statistics on the raster items in a mosaic dataset. This option only applies to mosaic datasets.

  • NONE —Statistics will be calculated for each raster item in the mosaic dataset (on each row in the attribute table). Any functions added to the raster item will be applied before generating the statistics. This is the default.
  • BUILD_ON_SOURCE —Builds pyramids and calculates statistics on the source data of the mosaic dataset.
Boolean
block_field
(Optional)

The name of the field within a mosaic dataset's attribute table used to identify items that should be considered one item when performing some calculations and operations.

String
estimate_statistics
(Optional)

Specify whether to calculate statistics for the mosaic dataset (not for the rasters within it). The statistics are derived from the existing statistics that have been calculated for each raster in the mosaic dataset.

  • NONE —Statistics are not calculated for the mosaic dataset. This is the default.
  • ESTIMATE_STATISTICS —Statistics will be calculated for the mosaic dataset.
Boolean
x_skip_factor
(Optional)

The number of horizontal pixels between samples.

The value must be greater than zero and less than or equal to the number of columns in the raster. The default is 1 or the last skip factor used.

Long
y_skip_factor
(Optional)

The number of vertical pixels between samples.

The value must be greater than zero and less than or equal to the number of rows in the raster. The default is 1 or the last y skip factor used.

Long
ignore_values
[ignore_value,...]
(Optional)

The pixel values that are not to be included in the statistics calculation.

The default is no value.

Long
pyramid_level
(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.

The maximum number of pyramid levels you can specify is 29. Any value that is 30 or higher will create a full set of pyramids.

Long
SKIP_FIRST
(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.

  • NONE —The first pyramid level will be built. This is the default.
  • SKIP_FIRST —The first pyramid level will not be built.
Boolean
resample_technique
(Optional)

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.
String
compression_type
(Optional)

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.
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 would produce a higher-quality image, but the compression ratio would be lower.

Long
skip_existing
(Optional)

Specify whether to calculate statistics only where they are missing or regenerate them even if they exist.

  • SKIP_EXISTING —Statistics will only be calculated if they do not already exist. This is the default.
  • OVERWRITE —Statistics will be calculated even if they already exist. Therefore, existing statistics will be overwritten.
Boolean

Code sample

BuildPyramidsAndStatistics example 1 (Python window)

This is a Python sample for the BuildPyramidsAndStatistics tool.

import arcpy
arcpy.BuildPyramidsAndStatistics_management(
     "C:/Workspace", "INCLUDE_SUBDIRECTORIES", "BUILD_PYRAMIDS",
     "CALCULATE_STATISTICS","BUILD_ON_SOURCE", "BlockField", 
     "ESTIMATE_STATISTICS", "10", "10", "0;255", "-1", "NONE",
     "BILINEAR", "JPEG", "50", "OVERWRITE")
BuildPyramidsAndStatistics example 2 (stand-alone script)

This is a Python script sample for the BuildPyramidsAndStatistics tool.

#Build pyramids and calculate statistics for all raster in a folder

import arcpy
arcpy.env.workspace = "C:/Workspace"

inws = "folder"
includedir = "INCLUDE_SUBDIRECTORIES"
buildpy = "BUILD_PYRAMIDS"
calcstats = "CALCULATE_STATISTICS"
buildsource = "NONE"
blockfield = "#"
estimatemd = "#"
skipx = "4"
skipy = "6"
ignoreval = "0;255"
pylevel = "3"
skipfirst = "NONE"
resample = "BILINEAR"
compress = "JPEG"
quality = "80"
skipexist = "SKIP_EXISTING"

arcpy.BuildPyramidsAndStatistics_management(
     inws, includedir, buildpy, calcstats, buildsource, blockfield,
     estimatemd, skipx, skipy, ignoreval, pylevel, skipfirst,
     resample, compress, quality, skipexist)

Environments

  • Pyramid
  • Raster Statistics
  • Current Workspace
  • Scratch Workspace
  • Parallel Processing Factor

Licensing information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Raster toolset
  • Environment settings for raster data
  • Raster pyramids
  • Raster data statistics
  • Setting the pyramid options for the geoprocessing environment
  • Setting the statistics settings for the geoprocessing environment

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal