For each raster property listed in this topic, there is a function or functions you can use to determine whether the raster has the property or what the value of a property is.
These functions can be used alone in SQL SELECT statements or as part of the WHERE clause in an UPDATE statement to restrict the values to be updated. Or, you might include these in a SELECT statement as part of a script to determine a raster property before you alter that property.
You can obtain general or specific properties of an ST_Raster value using the describe function.
If you use the describe function without specifying any arguments, general properties are returned to you. Alternatively, you can include an argument with the describe function to obtain a particular property. Possible arguments that can be used with the describe function are colormap and storage.
When you specify the colormap argument, the general properties of the ST_Raster value and the colormap index that has been applied to the raster are returned to you. If no color map exists on the raster value and you describe the colormap, you will receive an error message.
When you use the storage argument, the following information is returned to you in addition to general raster properties:
- The minimum values within each band and pyramid level
- The maximum values within each band and pyramid level
- The mean value of each band and pyramid level
- The standard deviation of the pixel values within each band and pyramid level
- A count of the total number of pixels in the raster value
- The compressed size of the raster value broken down by band and pyramid level
The following pixel values are supported for ST_Raster columns:
- 1bit: 1-bit data
- 4bit: 4-bit data
- uint8: Unsigned 8-bit integer
- int8: Signed 8-bit integer
- uint16: Unsigned 16-bit integer
- int16: Signed 16-bit integer
- uint32: Unsigned 32-bit integer
- int32: Signed 32-bit integer
- float: Single-precision, floating-point number
- double: Double-precision, floating-point number
Use the ST_Raster getPixelType function to determine what pixel value a specific ST_Raster value has.
When statistics are present on a raster value, ArcGIS for Desktop can stretch the raster when rendering it to make it easier to see. Raster statistics are also required to use geoprocessing tools with raster.
To determine whether or not an ST_Raster value has statistics calculated on it, use the ST_Raster hasStats function.
You could also use the hasStats function in the WHERE clause of an UPDATE statement to restrict the update to only those rasters that do not have statistics or only those records that do have statistics calculated on them.
The following compression types can be used for ST_Raster values:
- NONE: No compression was used to store the data.
- LZ77: LZ77 uses a length compression that is lossless and is best used on data of low variability or where other compression algorithms cannot be used.
- JPEG: JPEG stands for Joint Photographic Experts Group, the committee that developed the compression standard. JPEG is a lossy compression type. JPEG compression can only be applied to 8-bit data that does not have a colormap index.
- JP2: This is the JPEG 2000 wavelet-based compression type. This compression type can be applied to either 8-bit or 16-bit data.
You can use the getCompressionType function to determine which type of compression was applied to an ST_Raster value.
LZ77 compression is used most often. However, JPEG compression is used on three-band, 8-bit raster data or gray-scale data of high variability. JPEG2000 compression is usually reserved for 16-bit data.
Pyramid interpolation type
Pyramid interpolation is an algorithm applied when building pyramids on a raster value. Interpolation predicts values for cells in a raster value based on proximity to other raster values.
There are three possible pyramid interpolation types used with ST_Raster values: nearest, bilinear, and bicubic. To determine which type of interpolation was used when building a pyramid on a specific ST_Raster value, use the getInterpolationType function.
Bilinear interpolation is most often used because it yields a smoother image. However, bilinear interpolation does not maintain the pixel values of the predecessor level, cannot be used on data that has a colormap applied to it, and should not be used on pixel data that is less than 8 bit.
Typically, if bilinear interpolation is not used, the nearest neighbor pyramid interpolation type is.
If there is no pyramid on the raster value that you query with the getInterpolationType function, a null value is returned to you.
Interleave types are schemes for storing the actual pixel values of an image.
ST_Raster supports both the band interleaved by pixel (BIP) and band sequential (BSQ) interleave types. To determine which type is used on a specific ST_Raster value, use the getInterleaveType function.