7.8 SDO_GEOR.compressJP2
Format
SDO_GEOR.compressJP2( inGeoRaster IN SDO_GEORASTER, compressParam IN VARCHAR2 DEFAULT NULL, outGeoRaster IN OUT SDO_GEORASTER);
Description
Compresses the image in a GeoRaster object using JPEG 2000 compression.
Parameters
- inGeoRaster
-
The SDO_GEORASTER object whose data is to be compressed.
- compressParam
-
A string specifying one or more keywords for the compression parameter. For an explanation of the available keywords, see the table in the Usage Notes. If not specified, a lossless compression with default value for each keyword is applied.
- outGeoRaster
-
The SDO_GEORASTER object to hold the result of the compression. Must be either a valid existing GeoRaster object or an empty GeoRaster object. (Empty GeoRaster objects are explained in Blank and Empty GeoRaster Objects.) Cannot be the same GeoRaster object as
inGeoRaster
.
Usage Notes
The output compressed image is in JPEG 2000 (JP2) file format and stored in one raster block of the outGeoRaster
object. There are no pyramid raster blocks stored in the raster data table, because the pyramids are stored in the JP2 file as part of the compression.
If not specified in rlevel
keyword of compressParam
, the maximum number of pyramid level is calculated as: floor(log2(tsize))
, where tsize
is the minimal value of the tilesize
parameter values for rows and columns. If the tiling
parameter value isfalse
, tsize
is the minimal value of the image height and width.
If neither ratio
nor psnr
is specified, the compression is loss-less
This procedure supports 8–bit and 16–bit source GeoRaster objects. The maximum of number of tiles allowed is 65535.
The following table lists the available compressParam
keywords for JPEG 2000 (JP2) compression.
Table 7-1 compressParam Keywords for JPEG 2000 (JP2) Compression
Keyword | Explanation |
---|---|
Specifies the code block row and column size, where |
|
Specifies the discrete wavelet transform, where |
|
Specifies whether to use multiple component transform. By default, RGB->YCC conversion is used if there are 3 bands or more. |
|
Specifies the precinct size, where |
|
Specifies the progression order: |
|
Specifies the peak signal-to-noise ratio (PSNR), where p1, p2, p3, ... are the compression PSNR for layer 1, 2, 3, and so on of the JP2 code stream. It should be in increasing order. Example: psnr=(30, 40, 50). By default, the compression is loss-less. This parameter cannot be specified together with the |
|
Specifies the compression ratio, where p1, p2, p3, ... are the compression ratios for layers 1, 2, 3, and so on of the JP2 code stream. It should be in decreasing order. Example: ratio=(30, 20, 10). By default, the compression is loss-less. This parameter cannot be specified together with the |
|
Specifies the number of decompositions of the wavelet transform, and thus the number of pyramids of the image. By default, the level of decomposition is floor(log2(tileSize)). |
|
|
|
Specifies whether to use tiling in the JPEG2000 compression. By default, tiling is |
Note:
For any numbers in string (VARCHAR2) parameters to GeoRaster subprograms, the period (.) must be used for any decimal points regardless of the locale.
Examples
The following example creates a JPEG 2000 compressed GeoRaster object from the original object. The JP2 file internal tile size is 512 by 512 and the compression ratio values for JP2 layers 1, 2, and 3 are 30, 20, and 10, respectively. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Storage Parameters.)
DECLARE gr1 sdo_georaster; gr2 sdo_georaster; BEGIN INSERT INTO georaster_table (georid, georaster) VALUES (4, sdo_geor.init('RDT_1')) RETURNING georaster INTO gr2; SELECT georaster INTO gr1 FROM georaster_table WHERE georid=1; sdo_geor.compressJP2(gr1,’tilesize=(512, 512), ratio=(30, 20, 10)’, gr2); UPDATE georaster_table SET georaster=gr2 WHERE georid=4; COMMIT; END; /
Parent topic: SDO_GEOR Package Reference