7.132 SDO_GEOR.setGrayScale

Format

SDO_GEOR.setGrayScale(
     georaster    IN OUT SDO_GEORASTER, 
     layerNumber  IN NUMBER, 
     grayScale    IN SDO_GEOR_GRAYSCALE);

Description

Sets the grayscale mappings for a layer in a GeoRaster object, or deletes the existing values if you specify a null grayScale parameter.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to set the grayscale mappings. A value of 0 (zero) indicates the object layer.

grayScale

An object of type SDO_GEOR_GRAYSCALE, which is described in SDO_GEOR_GRAYSCALE Object Type.

Usage Notes

The following must be true of the specified SDO_GEOR_GRAYSCALE object:

  • The cellValue values are consistent with and in the value range for the cellDepth value of the GeoRaster object.

  • The gray value is an integer from 0 to 255.

  • The cellValue array contains no duplicate entries.

  • The entries in the cellValue array are in ascending order.

The GeoRaster object is automatically validated after the operation completes.

To return the grayscale mappings for a layer in a GeoRaster object, use the SDO_GEOR.getGrayScale function.

An exception is raised if layerNumber is null or invalid for the GeoRaster object, any gray values are null or out of scope, the cellValue array contains any duplicate values, or any cellValue values are null, out of scope, or out of order.

Examples

The following example sets the grayscale mappings for layer 3 of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Storage Parameters.)

DECLARE
  grobj sdo_georaster;
  gsobj sdo_geor_grayscale;
BEGIN
  gsobj := sdo_geor_grayscale(sdo_number_array(1, 10, 20, 30, 255),
                         sdo_number_array(0, 180, 210, 230, 250));
  
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setGrayScale(grobj, 3, gsobj);
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/