11.4 SDO_GEOR_IP.histogramMatch

Format

SDO_GEOR_IP.histogramMatch(
     inGeoRaster    IN SDO_GEORASTER, 
     pyramidLevel   IN NUMBER DEFAULT 0, 
     cropArea       IN SDO_NUMBER_ARRAY DEFAULT NULL, 
     bandNumbers    IN VARCHAR2, 
     refHistograms  IN SDO_GEOR_HISTOGRAM_ARRAY,
     storageParam   IN VARCHAR2 DEFAULT NULL, 
     outGeoraster   IN OUT SDO_GEORASTER,
     parallelParam IN VARCHAR2 DEFAULT NULL);

or

SDO_GEOR_IP.histogramMatch(
     inGeoRaster    IN SDO_GEORASTER, 
     pyramidLevel   IN NUMBER DEFAULT 0, 
     cropArea       IN SDO_GEOMETRY DEFAULT NULL, 
     layerNumbers   IN VARCHAR2, 
     refHistograms  IN SDO_GEOR_HISTOGRAM_ARRAY,
     storageParam   IN VARCHAR2 DEFAULT NULL, 
     outGeoraster   IN OUT SDO_GEORASTER,
     parallelParam IN VARCHAR2 DEFAULT NULL);

or

SDO_GEOR_IP.histogramMatch(
     inGeoRaster  IN SDO_GEORASTER, 
     pyramidLevel IN NUMBER DEFAULT 0, 
     cropArea     IN SDO_NUMBER_ARRAY DEFAULT NULL, 
     bandNumbers  IN VARCHAR2, 
     refGeoRaster IN SDO_GEORASTER, 
     storageParam IN VARCHAR2 DEFAULT NULL, 
     outGeoraster IN OUT SDO_GEORASTER,
     parallelParam IN VARCHAR2 DEFAULT NULL);

or

SDO_GEOR_IP.histogramMatch(
     inGeoRaster  IN SDO_GEORASTER, 
     pyramidLevel IN NUMBER DEFAULT 0, 
     cropArea     IN SDO_GEOMETRY DEFAULT NULL, 
     layerNumbers IN VARCHAR2, 
     refGeoRaster IN SDO_GEORASTER, 
     storageParam IN VARCHAR2 DEFAULT NULL, 
     outGeoraster IN OUT SDO_GEORASTER,
     parallelParam IN VARCHAR2 DEFAULT NULL);

Description

Processes the input GeoRaster object so that the histograms of the output GeoRaster object matches the histogram of a reference GeoRaster object (refGeoRaster) or a reference histogram (refHistograms).

Parameters

inGeoRaster

The SDO_GEORASTER object for the histogram matching operation.

pyramidLevel

A number specifying the pyramid level for the histogram matching operation. If null, the default is 0.

cropArea

Crop area definition. If cropArea is of type SDO_GEOMETRY, use the layerNumbers parameter to specify one or more layer numbers; if cropArea is of type SDO_NUMBER_ARRAY, use the bandNumbers parameter to specify one or more band numbers.

If the data type is SDO_NUMBER_ARRAY, the parameter identifies the upper-left (row, column) and lower-right (row, column) coordinates of a rectangular window, and raster space is assumed. If the data type is SDO_GEOMETRY, the minimum bounding rectangle (MBR) of the geometry object is used as the crop area; see also the Usage Notes for SDO_SRID requirements.

bandNumbers

A string identifying the physical band numbers on which the operation is to be performed. Use commas to delimit the values, and a hyphen to indicate a range (for example, 1-3 for bands 1, 2, and 3).

layerNumbers

A string identifying the logical layer numbers on which the operation is to be performed. Use commas to delimit the values, and a hyphen to indicate a range (for example, 2-4 for layers 2, 3, and 4).

refHistograms

An array of reference histograms. If there is only one element in the array, all the output bands match to this histogram; otherwise, the length of the array must be the same as the number of the bands in the output GeoRaster object.

refGeoRaster

The reference GeoRaster object. The reference GeoRaster object must have a histogram stored in the metadata, and must have the same number of bands as the input GeoRaster object.

storageParam

A string specifying storage parameters, as explained in Storage Parameters.

outGeoRaster

The output SDO_GEORASTER object that reflects the results of the operation. 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.

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. (For more information, see Parallel Processing in GeoRaster.)

If parallelism is specified, the procedure performs an internal commit while the process is running. Therefore, you cannot roll back the results of this procedure. If an error occurs (even if it is raised by the Oracle parallel server), you must delete the resulting output GeoRaster object explicitly in order to roll back the operation.

Usage Notes

The input GeoRaster object must have histograms generated for each band and stored in the metadata.

The reference GeoRaster object must have the same number of bands as the input GeoRaster object. The cell depth of the reference GeoRaster cannot be greater than the cell depth of the outGeoRaster object. The reference GeoRaster object must have histograms set in the metadata.

If the cropArea parameter data type is SDO_GEOMETRY, the SDO_SRID value must be one of the following:

  • Null, to specify raster space

  • A value from the SRID column of the MDSYS.CS_SRS table

    If the SDO_SRID values for the cropArea parameter geometry and the model space are different, the cropArea parameter geometry is automatically transformed to the coordinate system of the model space before the operation is performed. (Raster space and model space are explained in GeoRaster Data Model.)

Color map stored in the input GeoRaster object is not supported.

The output GeoRaster object has no pyramid or mask.

Examples

The following example creates a GeoRaster object that is the result of histogram matching the input GeoRaster object to the reference histograms. In the example, the reference histograms are stored in a table histogram_table(histogram sdo_geor_histogram, band number). (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;
  cropArea sdo_number_array := null;
  refHists sdo_geor_histogram_array;
BEGIN
  INSERT INTO georaster_table (georid, georaster)
    VALUES (41, sdo_geor.init('RDT_1'))
    RETURNING georaster INTO gr2;

  -- get the source GeoRaster object
  SELECT georaster INTO gr1 FROM georaster_table WHERE georid=4;

  -- get the reference histogram
  SELECT histogram bulk collect into refHists from histogram_table order by band;

  sdo_geor_ip.histogramMatch(gr1, 0, cropArea, null, refHists, null, gr2);
  UPDATE georaster_table SET georaster=gr2 WHERE georid=41;
  COMMIT;
END;
/

The following example creates a GeoRaster object that is the result of histogram matching the input GeoRaster object to the reference GeoRaster object. (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;
  refgr sdo_georaster;
  cropArea sdo_number_array := null;
BEGIN
  INSERT INTO georaster_table (georid, georaster)
    VALUES (41, sdo_geor.init('RDT_1'))
    RETURNING georaster INTO gr2;

  -- get the source GeoRaster object
  SELECT georaster INTO gr1 FROM georaster_table WHERE georid=4;

  -- get the reference GeoRaster object
  SELECT georaster INTO refgr FROM georaster_table WHERE georid=5;

  sdo_geor_ip.histogramMatch(gr1, 0, cropArea, null, refgr, null, gr2);
  UPDATE georaster_table SET georaster=gr2 WHERE georid=41;
  COMMIT;
END;
/