7.48 SDO_GEOR.getCellValue

Format

SDO_GEOR.getCellValue(
     georaster    IN SDO_GEORASTER, 
     pyramidLevel IN NUMBER, 
     rowNumber    IN NUMBER, 
     colNumber    IN NUMBER, 
     bandNumber   IN NUMBER 
     ) RETURN NUMBER;

or

SDO_GEOR.getCellValue(
     georaster    IN SDO_GEORASTER, 
     pyramidLevel IN NUMBER, 
     rowNumber    IN NUMBER, 
     colNumber    IN NUMBER, 
     bands        IN VARCHAR2 
     ) RETURN SDO_NUMBER_ARRAY;

or

SDO_GEOR.getCellValue(
     georaster    IN SDO_GEORASTER, 
     pyramidLevel IN NUMBER, 
     ptGeom       IN SDO_GEOMETRY, 
     layerNumber  IN NUMBER 
     ) RETURN NUMBER;

or

SDO_GEOR.getCellValue(
     georaster    IN SDO_GEORASTER, 
     pyramidLevel IN NUMBER, 
     ptGeom       IN SDO_GEOMETRY, 
     layers       IN VARCHAR2 
     ) RETURN SDO_NUMBER_ARRAY;

Description

Returns the value of a single cell located anywhere in the GeoRaster object by specifying its row, column, and band number or numbers in its cell coordinate system, or by specifying a point geometry in its model coordinate system and its logical layer number or numbers.

If the specified cell is in an empty raster block, the function returns a null value.

To change the value of raster data cells in a specified window of a GeoRaster object, use the SDO_GEOR.changeCellValue procedure.

Parameters

georaster

GeoRaster object.

pyramidLevel

Pyramid level containing the cell whose value is to be returned.

rowNumber

Number of the row that contains the cell whose value is to be returned.

colNumber

Number of the column that contains the cell whose value is to be returned.

bandNumber

Number of the physical band that contains the cell whose value is to be returned.

bands

A string identifying the physical band numbers on which the operation or operations are 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).

ptGeom

Point geometry that identifies the cell whose value is to be returned.

layerNumber

Number of the logical layer that contains the cell whose value is to be returned. (As mentioned in Bands_ Layers_ and Metadata, the logical layer number is the physical band number plus 1.)

layers

A string identifying the logical layer numbers on which the operation or operations are 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). (As mentioned in Bands_ Layers_ and Metadata, the logical layer number is the physical band number plus 1.)

Usage Notes

This function returns the original cell value stored in the raster object. It does not do any interpolation using cell values. (To evaluate a point location using an interpolation method, use the SDO_GEOR.evaluateDouble function.) It does not apply the scaling function defined in the metadata (which is typically used to scale the original cell data to a desired value or range of values), and it does not apply the bin function. To get the scaled cell value, follow these steps:

  1. Call the SDO_GEOR.getCellValue function to return the original cell value.

  2. Call the SDO_GEOR.getScaling function to return the coefficients of the scaling function (a0, a1, b0, b1).

  3. Using PL/SQL or another programming language, calculate the result using the following formula:

    value = (a0 + a1 * cellvalue) / (b0 + b1 * cellvalue)

Examples

The following example returns the values of four cells of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 21 in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Storage Parameters.

SELECT sdo_geor.getCellValue(georaster,0,383,47,0) V383_47,
       sdo_geor.getCellValue(georaster,0,47,383,0) V47_383,
       sdo_geor.getCellValue(georaster,0,128,192,0) V128_192,
       sdo_geor.getCellValue(georaster,0,320,256,0) V320_256
  FROM georaster_table WHERE georid=21;

   V383_47    V47_383   V128_192   V320_256
---------- ---------- ---------- ----------
        48         55         52         53

The following example returns the values of the cells in bands 0, 1, and 2 for row number 10, column number 10 of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 1 in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Storage Parameters.

SELECT sdo_geor.getcellvalue(a.georaster,0,10,10,'0-2')
  FROM georaster_table a WHERE georid=1;
 
SDO_GEOR.GETCELLVALUE(A.GEORASTER,0,10,10,'0-2')
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(88, 137, 32)