1.8 Pyramids
Pyramids are subobjects of a GeoRaster object that represent the raster image or raster data at differing sizes and degrees of resolution.
The size is usually related to the amount of time that an application needs to retrieve and display an image, particularly over the Web. That is, the smaller the image size, the faster it can be displayed; and as long as detailed resolution is not needed (for example, if the user has "zoomed out" considerably), the display quality for the smaller image is adequate.
Pyramid levels represent reduced or increased resolution images that require less or more storage space, respectively. (GeoRaster supports only reduced resolution pyramids.) A pyramid level of 0 indicates the original raster data; that is, there is no reduction in the image resolution and no change in the storage space required. Values greater than 0 (zero) indicate increasingly reduced levels of image resolution and reduced storage space requirements.
Pyramid type indicates the type of pyramid, and can be one of the following values:
-
DECREASE
means that pyramids decrease in size as the pyramid level increases. -
NONE
means that there are no pyramids associated with the GeoRaster object.
Figure 1-7 shows the concept of pyramid levels with a pyramid type of DECREASE
. It conveys the idea that as the pyramid level number increases, the file size decreases, but the resolution also decreases because fewer pixels are used to represent the image.
The size of the pyramid image at each level is determined by the original image size and the pyramid level, according to the following formulas:
r(n) = (int)(r(0) / 2^n) c(n) = (int)(c(0) / 2^n)
In the preceding formulas:
-
r(0)
andc(0)
are the original row and column dimension size. -
r(n)
andc(n)
are the row and column dimension size of pyramid level n. -
int
rounds off a number to the integer value that is less than but closest to that number. -
2^n
means 2 to the power of n.
The smaller of the row and column dimension sizes of the top-level overview (the smallest top-level pyramid) is 1. This determines the maximum reduced-resolution pyramid level, which is calculated as follows: (int)(log2(a))
In the preceding calculation:
-
log2
is a logarithmic function with 2 as its base. -
a
is the smaller of the original row and column dimension size.
The addressing of cells in the pyramid uses the same type of cell addressing as that defined for the original raster data, as described in GeoRaster Data Model. Each pyramid level has its own cell space; however, all cell spaces of the pyramid levels have the same type of cell coordinate system (either center-based or upper-left based) as that of the original level (level zero). The cells are squares with equal size and the unit is 1 cell. The upper-left corner cell in each pyramid level has the same ULTCoordinate as that of the original raster data, registered in the metadata. Based on this cell space definition and the pyramid levels, the cell coordinates in one pyramid level can be converted to another.
There is no separate SRS defined for each pyramid level in the GeoRaster metadata. The model coordinates of the cells in the pyramid are derived by first converting the cell coordinates of different pyramid level into cell coordinates of pyramid level zero and then applying the GeoRaster SRS. Conversely, the cell coordinates of ground points in the pyramid are derived by first obtaining the cell coordinates of those ground points in pyramid level zero using the GeoRaster SRS, and then converting them into a specific pyramid level. GeoRaster supports subcell addressing of pyramids in all parts of its API.
The pyramids are stored in the same raster data table as the GeoRaster object. The pyramidLevel attribute in the raster data table identifies all the blocks related to a specific pyramid level. In general, the blocking scheme for each pyramid level is the same as that for the original level (which is defined in the GeoRaster object metadata), except in the following cases:
-
If the original GeoRaster object is not blocked, that is, if the original cell data is stored in one block (BLOB) of the exact size of the object, the cell data of each pyramid level is stored in one block, and its size is the same as that of the actual pyramid level image.
-
If the original GeoRaster object is blocked (even if blocked as one block), the cell data of each pyramid level is blocked in the same way as for the original level data, and each block is stored in a different BLOB object as long as the maximum dimension size of the actual pyramid level image is larger than the block sizes. However, if lower-resolution pyramids are generated (that is, if both the row and column dimension sizes of the pyramid level are less than or equal to one-half the row block size and column block size, respectively), the cell data of each such pyramid level is stored in one BLOB object and its size is the same as that of the actual pyramid level image.
When pyramids are generated on a GeoRaster object or when a GeoRaster object is scaled, resampling of cell data is required. GeoRaster provides the standard resampling methods described in Resampling and Interpolation.
The following subprograms are associated with GeoRaster support for pyramids:
-
SDO_GEOR.generatePyramid generates pyramid data for a GeoRaster object.
-
SDO_GEOR.deletePyramid deletes pyramid data for a GeoRaster object.
-
SDO_GEOR.getPyramidMaxLevel returns the maximum pyramid level of a GeoRaster object.
-
SDO_GEOR.getPyramidType returns the pyramid type for a GeoRaster object.
Parent topic: GeoRaster Overview and Concepts