7.120 SDO_GEOR.setColorMap

Format

SDO_GEOR.setColorMap(
     georaster    IN OUT SDO_GEORASTER, 
     layerNumber  IN NUMBER, 
     colorMap     IN SDO_GEOR_COLORMAP);

Description

Sets the colormap for a layer in a GeoRaster object, or deletes the existing value if you specify a null colorMap parameter.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to perform the operation.

colorMap

Colormap object of type SDO_GEOR_COLORMAP, which is described in SDO_GEOR_COLORMAP Object Type.

Usage Notes

The following must be true of the specified colormap object:

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

  • The red, green, blue, and alpha values are integers 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.

You can create a colormap or retrieve a colormap from an existing GeoRaster object for use. To return the colormap for a layer in a GeoRaster object, use the SDO_GEOR.getColorMap function.

An exception is raised if layerNumber is null or invalid for the GeoRaster object, or if any of the following exist in colorMap: the red, green, blue, or alpha value is null or out of scope; duplicate values exist in the cellValue array, or any cellValue values are null, out of scope, or out of order.

Examples

The following example sets the colormap for layer 2 of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table. It assumes that the GeoRaster object is a bitmap. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Storage Parameters.)

DECLARE
  grobj sdo_georaster;
  cmobj sdo_geor_colormap;
BEGIN
  cmobj := sdo_geor_colormap(sdo_number_array(0, 1),
                             sdo_number_array(0, 255),
                             sdo_number_array(0, 0),
                             sdo_number_array(0, 0),
                             sdo_number_array(255, 255));

  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setColorMap(grobj, 2, cmobj);
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/