22

  Home    |    Concepts   |   API   |   Samples
Concepts > Rasters > Basic Principles
Pyramids

The raster pyramid is a series of reduced resolution representations of the raster base level, mainly used to improve the display performance when it is not necessary to work with the pixel information at full resolution. It contains a number of layers, each resampled at a more generalized level. Thus, each level of the pyramid is a resampled representation of the raster at a coarser spatial resolution.

Pyramids allow ArcSDE to fetch only the data at the specified resolution or level required for the display. Building of pyramids is performed on the ArcSDE server side whenever the underlying raster is modified or updated.

Generating pyramids requires resampling many input pixels to produce fewer output pixels. At each higher pyramid level, the pixel size doubles, resulting in four times fewer pixels. ArcSDE generates pyramids depending on the maximum number of levels and type of pixel data provided by the user. The pyramid begins at the base, or level 0, which contains the original pixels of the image, and proceeds toward the apex by coalescing four pixels from the previous level into a single pixel at the current level. This process continues until less than four pixels remain or until ArcSDE exhausts the defined number of levels.

A pyramid must always be generated from the upper leftmost coordinate (the image origin). If the image origin is moved, the entire pyramid must be re-generated. Hence, it is useful to preset the origin or the pyramid reference point when the raster is created.

Data pertaining to each pyramid level is stored in the Raster Block table. Thus, higher level pixels are calculated and stored in the Block table in advance and are not interpolated on the fly. Therefore, additional levels of the pyramid increase the number of raster block table rows by one-third. However, since it is possible for the user to specify the number of levels, the true apex of the pyramid may not be obtained, limiting the number of records added to the Raster Block table.

The pyramid allows ArcSDE to provide the application with a constant resolution of pixel data regardless of the rendering window’s scale. Data of a large raster transfers more quickly to the client when a pyramid exists, since ArcSDE can transfer fewer cells of a reduced resolution.

As mentioned earlier, the pyramid begins at level 0; therefore, the base layer of the pyramid has the highest resolution. The different levels are created by resampling the original data (by interpolating pixels in the original data). Interpolation is the process used to estimate an image value at a location in between image pixels. For example, if you resize an image so it contains more pixels than it did originally, the software obtains values for the additional pixels through interpolation.

There are three different methods for interpolating pixels: Nearest Neighbor, Bilinear, and Bicubic. The type of pixel data—discrete or continuous—determines which of the three methods is most suitable for a specific raster dataset.

The Nearest Neighbor interpolation method uses the value of the nearest pixel for interpolating pixel values for subsequent levels. It does not create new values, is the fastest interpolation method, and is best used for nominal or ordinal data. For these types of data, each value represents a class, member, or classification (categorical data, such as a land use, soil, or forest type).

The Bilinear Interpolation method takes the weighted average of four nearest pixels in the source image to estimate new pixel values for the destination image. This method is fastest for continuous data such as elevation, slope, intensity of noise from an airport, and salinity of the groundwater near an estuary.

 

The BiCubic Interpolation method estimates pixel values in the destination image by an average of 16 pixels surrounding the closest corresponding pixel in the source image and creates a smooth curve fitted to those 16 pixels, thus producing the most visually-pleasing output. This method is best used for continuous data, such as satellite imagery or aerial photography.

 

Pyramids, at full as well as at reduced resolutions, are tiled into raster tiles to reduce the amount of data ArcSDE needs to fetch from any one row. The number of pixels in one tile is static across pyramid levels. Thus, raster tiles at higher pyramid levels cover more geographic area than tiles at lower levels.

In the Raster Java API, ArcSDE creates pyramids using data supplied to the SeRasterAttr object through its setPyramidInfo() method. For the Raster C API, ArcSDE creates pyramids using data supplied to the SE_RASTERATTR structure through the SE_rasterattr_set_pyramid_info function. For either API, the user specifies values for the maximum number of levels in a pyramid and the interpolation method to be used. Setting the skip first level boolean parameter to TRUE directs ArcSDE to not store the first pyramid level, thus reducing the number of pyramids by 25 percent. This can be a significant savings of space when storage within the DBMS is at a premium.

LONG rc, max_level;
SE_RASTERATTR *raster_attrib;
SE_INTERPOLATION_TYPE interpolation;

if (interpolation == SE_INTERPOLATION_NONE)
      max_level = 0;
else
      max_level = SE_PYRAMID_AUTO_LEVEL;

rc = SE_rasterattr_set_pyramid_info (*raster_attrib, max_level, FALSE, interpolation);

SeRasterAttr attr = ......;
int maxLevel = x; //x > 0
int interpolation = y; // 0 < y < 2
boolean skipLevelOne = true;

attr.setPyramidInfo(maxLevel, skipLevelOne, interpolation);

The maximum level and interpolation can greatly affect storage requirements and client application performance. Hence, the type of pixel data should be taken into consideration while supplying the maximum level and interpolation values.

feedback | privacy | legal