13.10 SDO_GEOR_UTL.emptyBlocks

Format

SDO_GEOR_UTL.emptyBlocks(
     georaster     IN OUT SDO_GEORASTER, 
     bgValues      IN SDO_NUMBER_ARRAY DEFAULT NULL,
     parallelParam IN VARCHAR2 DEFAULT NULL);

Description

Trims all blocks that contain only the specified background values to empty LOBs, thus making them empty blocks. Can be used to reduce disk space required for GeoRaster storage.

Parameters

georaster

GeoRaster object.

bgValues

Background values for determining if a block can be made an empty raster block. The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filling value used for all layers) or the layer dimension size (a different filling value for each layer, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) means that a block with the first layer with 1, the second layer with 5, and the third layer with 10 are made empty blocks. If this parameter is null, then bgValues will be the default value (a single element SDO_NUMBER_ARRAY(0)).

parallelParam

Specifies the degree of parallelism for the operation. If specified, must be in the form parallel=n, where n is greater than 1. The database optimizer uses the degree of parallelism specified by this parameter. If not specified, then by default there is no parallel processing. See Parallel Processing in GeoRaster for more information.

Usage Notes

If georaster is null, this procedure performs no operation.

After running this procedure, the LOB storage space can be shrunk using “ALTER TABLE” statement as shown:

ALTER TABLE <rdt_table_name> MODIFY LOB (rasterblock)(SHRINK SPACE);

See ALTER TABLE in Oracle Database SQL Language Reference for more information.

Contrast this procedure with SDO_GEOR_UTL.fillEmptyBlocks, which uses specified background values to fill in all empty blocks.

Examples

The following example empties blocks whose cell values are background values (255,0,0).

DECLARE
  geor  SDO_GEORASTER;
BEGIN
  SELECT georaster INTO geor FROM georaster_table WHERE georid = 3 FOR UPDATE;
  SDO_GEOR_UTL.emptyBlocks(geor, SDO_NUMBER_ARRAY(255,0,0));
  UPDATE georaster_table SET georaster = geor WHERE georid = 3;
  COMMIT;
END;
/