4 SDO_GEOR Package Reference

The MDSYS.SDO_GEOR package contains subprograms (functions and procedures) for creating, modifying, and retrieving information about GeoRaster objects. This chapter presents reference information, with one or more examples, for each subprogram.

The subprograms are presented in alphabetical order in this chapter. They can be grouped into several logical categories, as explained in Section 1.12. Many of the subprograms are also discussed in Chapter 3, "GeoRaster Operations".

Many examples in this chapter refer to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.

All SDO_GEOR subprograms can work on GeoRaster objects defined in schemas other than the current connection schema.


SDO_GEOR.addNODATA

Format

SDO_GEOR.addNODATA(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     nodata IN NUMBER);

or

SDO_GEOR.addNODATA(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     nodata IN SDO_RANGE_ARRAY);

Description

Adds one or more NODATA values or value ranges, to represent NODATA cells in one layer or all layers in a GeoRaster object.

Parameters

georaster

GeoRaster object.

layerNumber

Layer number in the GeoRaster object. A value of 0 (zero) indicates the object layer.

nodata

Either a single numeric value, or an array of numbers or number ranges. Any NODATA value range is inclusive at the lower bound and exclusive at the upper bound.

The SDO_RANGE_ARRAY type is described in Section 1.9

Usage Notes

Some cells of a GeoRaster object may have no meaningful value assigned or collected. Such cells contain a NODATA value are thus called NODATA cells, which means that those cells are not semantically defined. The application is responsible for defining the meaning or significance of cells identified as NODATA cells. For more information about NODATA values and value ranges, see Section 1.9.

Any NODATA values or value ranges associated with the object layer apply to all sublayers. For an explanation of layers, the object layer, and sublayers, see Section 1.5.

NODATA values must be in the valid cell value range. Both the lower bound and the upper bound of a NODATA value range must be valid cell values as specified by the cell depth. Because NODATA value ranges are exclusive at the upper bound, if you want to specify the maximum valid cell value as NODATA, you must specify the maximum valid cell value as a single numeric NODATA value.

This procedure associates NODATA values or value ranges with a raster layer incrementally. It removes duplicate values or value ranges and combines adjacent values or value ranges to form a compact representation in the metadata whenever feasible. However, a single numeric NODATA value that is equal to the upper bound of a NODATA value range will not be combined together with the value range because it is not always feasible to calculate the new exclusive upper bound.

To delete one or more NODATA values or value ranges, use the SDO_GEOR.deleteNODATA procedure. To return the NODATA values for a GeoRaster object, use the SDO_GEOR.getNODATA function.

Examples

The following example specifies that cells with values that are greater than or equal to 5 and less than 7, or that are equal to 9, are to be considered NODATA cells for the object layer (and thus all sublayers) of a specified GeoRaster object.

DECLARE
  gr sdo_georaster;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=1 FOR UPDATE;
  SDO_GEOR.addNODATA(gr, 0, sdo_range_array(sdo_range(5,7), sdo_range(9,null)));
  UPDATE georaster_table SET georaster=gr WHERE georid=1;
  COMMIT;
END;
/

SDO_GEOR.addSourceInfo

Format

SDO_GEOR.addSourceInfo(

     georaster IN OUT SDO_GEORASTER,

     sourceInfo IN VARCHAR2);

Description

Adds to the source information for a GeoRaster object.

Parameters

georaster

GeoRaster object.

sourceInfo

String with source information. Cannot exceed 4096 characters.

Usage Notes

The specified sourceInfo string is added to the <sourceInfo> element in the metadata for the GeoRaster object (described in Appendix A). You can call this procedure as many times as needed to put multiple string values in the <sourceInfo> element or to add string values to any existing values.

If you want to replace any existing source information value or values, use the SDO_GEOR.setSourceInfo procedure.

Examples

The following example sets and adds some source information for a specified GeoRaster object, and then retrieves the information.

declare
 gr sdo_georaster;
begin
 select georaster into gr from georaster_table where georid=1 for update;
 sdo_geor.setSourceInfo(gr, 'Copyright (c) 2002, 2007, Oracle Corporation.');
 sdo_geor.addSourceInfo(gr, 'All rights reserved.');
 update georaster_table set georaster=gr where georid=1;
end;
/
 
select * from table(select sdo_geor.getSourceInfo(georaster) from georaster_table where id=1);
 
COLUMN_VALUE
--------------------------------------------------------------------------------
Copyright (c) 2002, 2007, Oracle Corporation.
All rights reserved.

SDO_GEOR.calcCompressionRatio

Format

SDO_GEOR.calcCompressionRatio(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the compression ratio of a specified GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

The compression ratio is the sum of the sizes of all raster blocks (including pyramids) in the uncompressed GeoRaster object divided by the sum of these sizes in the compressed form of the object. If the input GeoRaster object is not compressed, the compression ratio is 1 (that is, 1:1).

For a given original GeoRaster object, the greater the compression ratio, the smaller is the compressed GeoRaster object. For example, a compression ratio of 20 (that is, 20:1), the data is compressed to 5 percent of its original size.

For more information about GeoRaster compression, see Section 1.10.

Examples

The following example returns the compression type and compression ratio for the GeoRaster object in the GEORASTER column of table GEORASTER_TABLE where the GEORID column value is 1.

SELECT sdo_geor.getCompressionType(georaster) compType,
    sdo_geor.calcCompressionRatio(georaster) compRatio
  FROM georaster_table WHERE georid=1;

SDO_GEOR.changeCellValue

Format

SDO_GEOR.changeCellValue(

     georaster IN OUT SDO_GEORASTER,

     window IN SDO_NUMBER_ARRAY,

     bandNumbers IN VARCHAR2,

     newCellValue IN NUMBER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.changeCellValue(

     georaster IN OUT SDO_GEORASTER,

     window IN SDO_GEOMETRY,

     layerNumbers IN VARCHAR2,

     newCellValue IN NUMBER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Changes the value of raster cells in a specified window of a GeoRaster object to a single new value.

Parameters

georaster

GeoRaster object.

window

Window in which to change the values of all cells to newCellValue. The data type can be SDO_NUMBER_ARRAY or SDO_GEOMETRY. 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, see the Usage Notes for SDO_SRID requirements and other information.

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).

newCellValue

The new cell value for each cell inside the window in the specified bands or layers. The value must be in the range designated by the cellDepth value for the GeoRaster object.

bgValues

Background values for filling partially empty raster blocks. It is only useful when the source GeoRaster object has empty raster blocks and the current operation leads to partially empty raster blocks (see Section 1.4.4). The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filing value used for all bands) or the band dimension size (a different filling value for each band, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) fills the first band with 1, the second band with 5, and the third band with 10.

The filling values must be valid cell values as specified by the target cell depth background values for filling sparse data.

Usage Notes

Because this procedure overwrites data in the input GeoRaster object, you should make a copy of the original GeoRaster object and use this procedure on the copied object. After you are satisfied with the result of this procedure, you can discard the original GeoRaster object if you wish.

This procedure can be used to mask, or conceal, parts of an image. For example, you can change irrelevant parts of an image to a dull color before displaying the image, to help people to focus on the relevant parts.

If the window 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 window parameter geometry and the model space are different, the window 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 Section 1.3.)

If the window parameter specifies a nonrectangular SDO_GEOMETRY object, this function calculates the MBR of the geometry and update the cells inside that MBR, including the cells on the boundary of the MBR.

If the window parameter specifies a geodetic MBR, it cannot cross the date line meridian. For information about geodetic MBRs, see Oracle Spatial Developer's Guide.

If georaster is a blank GeoRaster object and the whole area is updated, the result is a blank GeoRaster object with the blankCellValue value set to newCellValue.

If georaster is a blank GeoRaster object and it is only partially updated, the result is a nonblank GeoRaster object with the original blankCellValue and newCellValue values set according to the window parameter and the bandNumbers or layerNumbers parameter.

If georaster is a nonblank GeoRaster object, the result is a nonblank GeoRaster object, even if all cells are set to the newCellValue value.

If georaster is null, this procedure performs no operation. If georaster is invalid, an exception is raised.

If any pyramids are defined on the GeoRaster object, the corresponding cell values for the pyramids are updated.

To return the value of a single cell located anywhere in the GeoRaster object, use the SDO_GEOR.getCellValue function.

Examples

The following example changes the value of all cells to 151 in a specified window in band number 1. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  gr sdo_georaster;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=110 FOR UPDATE;
  sdo_geor.changeCellValue(gr, sdo_number_array(100,67,134,113), '1', 151);
  UPDATE georaster_table SET georaster=gr WHERE georid=110;
  COMMIT;
END;
/

SDO_GEOR.changeFormatCopy

Format

SDO_GEOR.changeFormatCopy(

     inGeoRaster IN SDO_GEORASTER,

     storageParam IN VARCHAR2,

     outGeoRaster IN OUT SDO_GEORASTER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.changeFormatCopy(

     inGeoRaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     storageParam IN VARCHAR2,

     outGeoRaster IN OUT SDO_GEORASTER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Makes a copy of an existing GeoRaster object using a different storage format (for example, changing the blocking, cell depth, or interleaving).

Parameters

inGeoRaster

The SDO_GEORASTER object whose format is to be copied.

pyramidLevel

A number specifying the pyramid level of the source GeoRaster object.

storageParam

A string specifying storage parameters, as explained in Section 1.4.1.

outGeoRaster

The SDO_GEORASTER object to hold the copy. Must be either a valid existing GeoRaster object or an empty GeoRaster object. (Empty GeoRaster objects are explained in Section 1.4.3.) Cannot be the same GeoRaster object as inGeoRaster.

bgValues

Background values for filling partially empty raster blocks. It is only useful when the source GeoRaster object has empty raster blocks and the current operation leads to partially empty raster blocks (see Section 1.4.4). The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filing value used for all bands) or the band dimension size (a different filling value for each band, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) fills the first band with 1, the second band with 5, and the third band with 10.

The filling values must be valid cell values as specified by the target cell depth background values for filling sparse data.

Usage Notes

This procedure creates a new GeoRaster object that has the specified changes, based on the original GeoRaster object or a specified pyramid level of it. After you use this procedure, you can check to ensure that the desired changes were made in the copy, and then discard the original GeoRaster object if you wish.

If you use the format that does not include the pyramidLevel parameter, the copy is based on the original GeoRaster object (pyramidLevel=0).

If the copy is to be made from a pyramid of the original GeoRaster object (pyramidLevel > 0), and if the original GeoRaster object is georeferenced, georeferencing information is generated for the resulting GeoRaster object only when the georeference is a valid polynomial transformation. The resulting object's row and column ultCoordinates are set to (0,0).

To compress or decompress a GeoRaster object, use the compression keyword in the storageParam parameter. (There is no separate GeoRaster function or procedure for compressing or decompressing a GeoRaster object.)

If inGeoRaster is null, this procedure performs no operation.

If storageParam is null, inGeoRaster is copied to outGeoRaster.

If outGeoRaster has any raster data, it is deleted before the copy operation.

inGeoRaster and outGeoRaster must be different GeoRaster objects.

If pyramid data exists for inGeoRaster, any upper level pyramid data is copied to outGeoRaster unless the storageParam string contains pyramid=FALSE.

An exception is raised if one or more of the following are true:

  • inGeoRaster is invalid.

  • outGeoRaster has not been initialized.

  • A raster data table for outGeoRaster does not exist and outGeoRaster is not a blank GeoRaster object.

Examples

The following example creates a GeoRaster object that is the same as the input object except that the block size is set to 2048 for both dimensions. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
    gr1 sdo_georaster;
    gr2 sdo_georaster;
BEGIN
    SELECT georaster INTO gr2 from georaster_table WHERE georid=11 FOR UPDATE;
    SELECT georaster INTO gr1 from georaster_table WHERE georid=1;
  
    sdo_geor.changeFormatCopy(gr1, 'blocksize=(2048,2048)', gr2);
    UPDATE georaster_table SET georaster=gr2 WHERE georid=11;
    COMMIT;
END;
/

SDO_GEOR.copy

Format

SDO_GEOR.copy(

     inGeoRaster IN SDO_GEORASTER,

     outGeoRaster IN OUT SDO_GEORASTER);

Description

Makes a copy of an existing GeoRaster object.

Parameters

inGeoRaster

GeoRaster object to be copied.

outGeoRaster

GeoRaster object to hold the result of the copy operation. Must be either a valid existing GeoRaster object or an empty GeoRaster object. (Empty GeoRaster objects are explained in Section 1.4.3.) Cannot be the same GeoRaster object as inGeoRaster.

Usage Notes

The outGeoRaster object is an exact copy of the inGeoRaster object. To make any changes to the output GeoRaster object during a copy operation, use the SDO_GEOR.changeFormatCopy procedure.

If inGeoRaster is null, this procedure performs no operation.

If outGeoRaster has any raster data, it is deleted before the copy operation.

inGeoRaster and outGeoRaster must be different GeoRaster objects.

If pyramid data exists for inGeoRaster, the pyramid data is copied to outGeoRaster.

An exception is raised if one or more of the following are true:

  • inGeoRaster is invalid.

  • outGeoRaster has not been initialized.

  • A raster data table for outGeoRaster does not exist and outGeoRaster is not a blank GeoRaster object.

Examples

The following example inserts an initialized GeoRaster object (gr2) into the GEORASTER column of table GEORASTER_TABLE, makes gr2 an exact copy of another GeoRaster object (gr1), and updates the row that had been inserted using gr2 for the GEORASTER column value. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  gr1 sdo_georaster;
  gr2 sdo_georaster;
BEGIN
  INSERT INTO georaster_table VALUES (11, sdo_geor.init('RDT_11', 1))
    RETURNING georaster INTO gr2;
  SELECT georaster INTO gr1 from georaster_table WHERE georid=1;

  sdo_geor.copy(gr1, gr2);
  UPDATE georaster_table SET georaster=gr2 WHERE georid=11;
  COMMIT;
END;
/

SDO_GEOR.createBlank

Format

SDO_GEOR.createBlank(

     rasterType IN INTEGER,

     ultCoord IN SDO_NUMBER_ARRAY,

     dimSizes IN SDO_NUMBER_ARRAY,

     cellValue IN NUMBER,

     rasterDataTable IN VARCHAR2 DEFAULT NULL,

     rasterID IN NUMBER DEFAULT NULL

     ) RETURN SDO_GEORASTER;

Description

Creates a blank GeoRaster object, in which all cells have the same value; the object must then be registered in the xxx_SDO_GEOR_SYSDATA views (see the Usage Notes)

Parameters

rasterType

The 5-digit rasterType attribute value, as specified in Section 2.1.1.

ultCoord

An array of the upper-left coordinate integer values for the GeoRaster object. The default value is (0,0) for a GeoRaster object without a band dimension, and (0,0,0) for a GeoRaster object with a band dimension. If this parameter is null, the default value of 0 is used for each dimension. If a value in the specified array is null, the default value of 0 is used for the corresponding dimension. The value for the band dimension must be 0, and you do not need to specify it. (If you specify an array of values, the number of values must not be less than the number of the spatial dimensions or more than the number of total dimensions.)

dimSizes

The number of cells along each dimension. The number of values in the array must be equal to the total number of dimensions, and the size of each dimension must be explicitly specified. The row and column dimension sizes must be greater than 1.

cellValue

The cell value for all raster cells in the created GeoRaster object. Must be from 0 to 255, because the cell depth of the created GeoRaster object is 8BIT_UNSIGNED.

rasterDataTable

Name of the object table of type SDO_RASTER that stores the cell data blocks. Must not contain spaces, period separators, or mixed-case letters in a quoted string; the name is always converted to uppercase when stored in an SDO_GEORASTER object. The RDT should be in the same schema as its associated GeoRaster table. If you do not specify this parameter, GeoRaster generates a unique table name to be used for the raster data table. If you specify this parameter and the table already exists but is not an object table of type SDO_RASTER, an exception is raised.

rasterID

Number that uniquely identifies the cell blocks of this GeoRaster object in the raster data table. If you do not specify this parameter, a unique sequence number is generated for the ID.

Usage Notes

After creating the blank GeoRaster object and before performing any operations on the object, you must register it in the xxx_SDO_GEOR_SYSDATA views by inserting the empty GeoRaster object into a GeoRaster table. (The xxx_SDO_GEOR_SYSDATA views are described in Section 2.4. GeoRaster operations are described in Chapter 3.)

The created GeoRaster object has no spatial reference information; therefore, its spatial extent geometry has a null SRID (coordinate system) value. The spatial extent geometry reflects the ultCoord and dimSizes values.

This function does not require that the specified raster data table exist. However, the table must exist before any raster data can be inserted into it.

Although the cell depth of the created GeoRaster object is 8BIT_UNSIGNED, you can change the cell depth after you create the blank GeoRaster object by calling the SDO_GEOR.changeFormatCopy procedure. You can then call the SDO_GEOR.setBlankCellValue procedure to reset the cell value in a different range.

For guidelines that apply to the SDO_GEOR.createBlank and SDO_GEOR.init functions when a table has multiple GeoRaster object columns, see the Usage Notes for the SDO_GEOR.init function.

An exception is raised if any value for an input parameter is invalid.

Examples

The following example inserts a row containing a blank GeoRaster object into the table. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

INSERT INTO georaster_table (georid, georaster) VALUES (
  1,
  sdo_geor.createBlank(20001, SDO_NUMBER_ARRAY(0,0),
                       SDO_NUMBER_ARRAY(1024,1024), 255, 'RDT_1')
);

SDO_GEOR.createTemplate

Format

SDO_GEOR.createTemplate(

     georaster IN OUT SDO_GEORASTER,

     rasterType IN INTEGER,

     rasterSpec IN VARCHAR2,

     maskLayers IN VARCHAR2 DEFAULT NULL,

     initRDTEntry IN VARCHAR2 DEFAULT NULL

     ) ;

Description

Populates a GeoRaster object with metadata of a general pattern, and optionally inserts entries with empty raster blocks into its raster data table.

Parameters

georaster

The GeoRaster object to be updated.

rasterType

The 5-digit rasterType attribute value, as specified in Section 2.1.1.

rasterSpec

A string with raster specification parameters, as explained in the Usage Notes.

maskLayers

A string identifying the logical layer numbers on which there are associated bitmap masks. Use commas to delimit the values, and a hyphen to indicate a range (for example, 2-4 for layers 2, 3, and 4).

initRDTEntry

The string TRUE causes the raster data table to be populated; the string FALSE causes the raster data table not to be populated. If you do not specify this parameter, the raster data table is not populated.

Usage Notes

This function populates a GeoRaster object with metadata of a general pattern and optionally inserts proper rows (with empty raster blocks) into its raster data table. If the raster data table is to be populated, the raster data table must exist and the GeoRaster object must have been registered in the GeoRaster SYSDATA table.

In general, only use this procedure with an empty GeoRaster object to populate its XML metadata and raster blocks. If you use an existing (good) GeoRaster object, the GeoRaster object will be replaced with the new template object upon update.

The rasterSpec parameter must be a quoted string that contains one or more of the following keyword-value pairs:

  • dimSize (for example, dimSize=(256,256,3)): Specifies the row, column, and band dimension sizes. This keyword must be specified and must be consistent with the rasterType parameter.

  • ultCoord (for example, ultCoord=(0,0,0)): Specifies the upper-left coordinate integer values for the GeoRaster object. The default value is 0 for all the dimensions. The value for the band dimension must be 0.

  • cellDepth (for example, cellDepth=8BIT_S): Specifies the cell depth of the GeoRaster object. Must be one of the following values (with _U indicating unsigned and _S indicating signed): 1BIT, 2BIT, 4BIT, 8BIT_U, 8BIT_S, 16BIT_U, 16BIT_S, 32BIT_U, 32BIT_S, 32BIT_REAL, or 64BIT_REAL. The default value is 8BIT_U.

  • interleaving (for example, interleaving=BIP): Specifies the interleaving type. Must be one of the following values: BSQ, BIL, or BIP. The default value is BSQ.

  • blocking (for example, blocking=TRUE): Specified whether the GeoRaster object is blocked. Must be either TRUE or FALSE. The default value is FALSE if blocksize is not specified.

  • blocksize (for example, blocksize=(128,128,3)): Specifies the block size for each dimension of the GeoRaster object. The values must be non-negative integers. A zero block size value means the corresponding dimension size is the real value. Is blocking is set to TRUE but blocksize is not specified, the GeoRaster object's blocksize is (256,256,B), where B is the band dimension size.

  • rLevel (for example, rLevel=2): Specifies the maximum pyramid reduction level. Must be a positive integer. If you specify this keyword, the pyramid type is set to DECREASE in the metadata; otherwise the pyramid type is set to NONE.

  • resampling (for example, resampling=NN): Specifies the resampling method. Must be one of the following: NN (value of the nearest neighbor cell in the original GeoRaster object), BILINEAR (distance-weighted average of the 4 nearest cells in the original GeoRaster object), AVERAGE4 (simple average of the 4 nearest cells in the original GeoRaster object), AVERAGE16 (simple average of the 16 nearest cells in the original GeoRaster object), CUBIC (cubic convolution of the 16 nearest cells in the original GeoRaster object). This keyword is ignored if rLevel is not set.

  • compression (for example, compression=JPEG-B): Specifies the compression type of the GeoRaster object. Must be one of the following: NONE, DEFLATE, JPEG-B, or JPEG-F. The default value is NONE.

  • quality (for example, quality=75): Specifies the JPEG compression quality, which is the degree of lossiness caused by the compression. Must be an integer from 0 (lowest quality) through 100 (highest quality). This keyword is ignored when the compression keyword is not specified or is not set to one of the JPEG types.

For more information about using this function in developing GeoRaster applications, see Section 3.17.

Examples

The following example populates a GeoRaster object with metadata and initial raster data table rows.

DECLARE
  gr sdo_georaster;
BEGIN
  INSERT INTO georaster_table (georid, georaster)
    VALUES (1, sdo_geor.init('RDT_1'))
    RETURNING georaster into gr;
  sdo_geor.createTemplate(gr, 21001,
                       'dimSize=(128,128,3) blocking=false rlevel=2',
                       null, 'TRUE');
  UPDATE georaster_table set georaster=gr where georid=1;
  COMMIT;
END;
/

SDO_GEOR.deleteNODATA

Format

SDO_GEOR.deleteNODATA(

     georaster IN OUT SDO_GEORASTER

     layerNumber IN NUMBER

     nodata IN NUMBER);

or

SDO_GEOR.deleteNODATA(

     georaster IN OUT SDO_GEORASTER

     layerNumber IN NUMBER

     nodata IN SDO_RANGE_ARRAY);

Description

Deletes one or more NODATA values or value ranges.

Parameters

georaster

GeoRaster object.

layerNumber

Layer number in the GeoRaster object. A value of 0 (zero) indicates the object layer.

nodata

Either a single numeric value, or an array of numbers or number ranges. Any NODATA value range is inclusive at the lower bound and exclusive at the upper bound.

The SDO_RANGE_ARRAY type is described in Section 1.9

Usage Notes

When a NODATA value or value range is deleted, the cell depth of the GeoRaster object is taken into consideration to generate the correct new ranges. If the cell depth specifies floating cell values, you can only remove existing single numeric NODATA values or remove a sub-range from an existing NODATA value range.

For information about NODATA values and value ranges, see Section 1.9.

To add one or more NODATA values or value ranges, use the SDO_GEOR.addNODATA procedure. To return the NODATA values for a GeoRaster object, use the SDO_GEOR.getNODATA function.

Examples

The following example removes cell value 9 from the NODATA metadata associated with the object layer.

DECLARE
  gr sdo_georaster;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=0 FOR UPDATE;
  SDO_GEOR.deleteNODATA(gr, 0, 9);
  UPDATE georaster_table SET georaster=gr WHERE georid=0;
  COMMIT;
END;
/

SDO_GEOR.deletePyramid

Format

SDO_GEOR.deletePyramid(

     georaster IN OUT SDO_GEORASTER);

Description

Deletes the pyramid data of a GeoRaster object.

Parameters

georaster

GeoRaster object for which pyramid data is to be deleted.

Usage Notes

For information about pyramid data, see Section 1.7.

If georaster is null or has no pyramid data, this procedure performs no operation.

An exception is raised if georaster is invalid.

Examples

The following example deletes the pyramid data for a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  gr1 sdo_georaster;
BEGIN
  SELECT georaster INTO gr1 FROM georaster_table WHERE georid=21;

  sdo_geor.deletePyramid(gr1);
  UPDATE georaster_table SET georaster=gr1 WHERE georid=21;
  COMMIT;
END;
/

SDO_GEOR.exportTo

Format

SDO_GEOR.exportTo(

     georaster IN SDO_GEORASTER,

     subsetParam IN VARCHAR2,

     r_destFormat IN VARCHAR2,

     r_destType IN VARCHAR2,

     r_destName IN VARCHAR2,

     h_destFormat IN VARCHAR2 DEFAULT NULL,

     h_destType IN VARCHAR2 DEFAULT NULL,

     h_destName IN VARCHAR2 DEFAULT NULL);

or

SDO_GEOR.exportTo(

     georaster IN SDO_GEORASTER,

     subsetParam IN VARCHAR2,

     r_destFormat IN VARCHAR2,

     r_destBLOB IN OUT NOCOPY BLOB);

or

SDO_GEOR.exportTo(

     georaster IN SDO_GEORASTER,

     subsetParam IN VARCHAR2,

     r_destFormat IN VARCHAR2,

     r_destBLOB IN OUT NOCOPY BLOB,

     h_destFormat IN VARCHAR2 DEFAULT NULL,

     h_destCLOB IN OUT NOCOPY CLOB DEFAULT NULL);

Description

Exports a GeoRaster object or a subset of a GeoRaster object to a file or to a BLOB object.

Parameters

georaster

GeoRaster object that will be exported.

subsetParam

String containing subset parameters, for exporting a subset of the GeoRaster object. The format and usage are as explained in Section 1.4.1, although some keywords described in that section do not apply to this procedure. The following keywords are supported:

  • pLevel: Pyramid level to be exported. The default is 0.

  • cropArea: Specify the area to be exported in the format cropArea = (startCol, startRow, endCol, endRow). startCol is the index of the leftmost pixel to be exported relative to the original image; startRow is the index of the top pixel to be exported; endCol is the index of the rightmost pixel to be exported; and endRow is the index of the bottom pixel to be exported. If cropArea is not specified, the entire image is exported.

  • layerNumbers: Layer numbers of the layers to be exported. For example, layerNumbers=(3-5) exports layers 3, 4, and 5; and layerNumbers=(1,3,5) exports layers 1, 3, and 5.

r_destFormat

Raster destination format. Must be one of the following: TIFF, BMP, GeoTIFF, or PNG. (JPEG and GIF are not supported for this procedure.)

r_destType

Type of destination for the export operation. Must be FILE.

r_destName

Destination file name (with full path specification) if destType is FILE. Do not specify the file extension. If you are using this procedure only to export the world file, specify a null value for this parameter.

r_destBLOB

BLOB object to hold the image file resulting from the export operation.

h_destFormat

Geoheader destination format. Must be WORLDFILE.

h_destType

Geoheader type of destination for the export operation. Must be FILE.

h_destName

Geoheader destination file name (with full path specification) if h_destType is FILE. Do not specify the file extension.

h_destCLOB

CLOB object to hold the geoheader file resulting from the export operation.

Usage Notes

Use a format with both r_xxx and h_xxx parameters only if the raster image and geoheader are in separate files.

This procedure does not support JPEG or GIF as a destination file format. You can use the client-side GeoRaster exporter tool, described in Section 1.13, to export to a JPEG file.

This procedure does not support GeoRaster objects that have a cellDepth value of 2BIT.

GeoRaster objects with a cell depth of 8 bits or greater that have a BSQ or BIL interleaving are exported in BIP interleaved format.

The GeoTIFF PixelIsArea raster space is equivalent to the GeoRaster upperleft-based cell coordinate system. An export to GeoTiff is always in PixelIsArea raster space, with a half-pixel adjustment of the affine transformation if the GeoRaster object is in center-based cell coordinate system.

To load GeoTIFF images with the SDO_GEOR.importFrom procedure, you will need the xtiff-jai.jar and geotiff-jai.jar libraries. For more information about these GeoTIFF libraries, see Section 3.5.

Before you call this procedure, you must have write permission on the output file or the directory to contain the files. The following example (run as user SYSTEM) grants write permission on a specified file to user HERMAN:

call dbms_java.grant_permission('HERMAN','SYS:java.io.FilePermission',
   '/mydirectory/myimages/img1.tif', 'write' );

The maximum amount of GeoRaster data that can be exported in a single operation is 67 megabytes (MB). Thus, the maximum dimensions of a GeoRaster object that can be exported at one time must be such that width*height*bands*cellDepth/8 <= 67 MB and rowBlockSize*columnBlockSize*bands*cellDepth/8 <= 67 MB. For example, for a 3-band, 8-bit GeoRaster object in which the width and height are equal:

  • The largest exportable width and height are 4728x4728.

  • The largest exportable block dimensions are 4096x4096.

Examples

The following example shows two export operations. The first operation exports an entire GeoRaster object (except for any georeferencing information) into a BMP format file. The second operation exports a subset of the GeoRaster object to a file with an ESRI world file.

DECLARE 
  geor SDO_GEORASTER;
  fileName VARCHAR2(1024);
  tfwName VARCHAR2(1024);
 
BEGIN
 
SELECT georaster INTO geor FROM georaster_table WHERE georid = 1;
 
-- Export the whole GeoRaster object into a BMP file, excluding any
-- georeferencing information.
sdo_geor.exportTo(geor, NULL, 'BMP', 'file',
  '/mydirectory/myimages/img1_export');
 
-- Export a subset to a file with a world file.
fileName := '/mydir/parrotExported';
tfwName := '/mydir/parrotWorldFile';
SELECT georaster INTO geor FROM georaster_table WHERE georid = 8;
sdo_geor.exportTo(geor, 'cropArea=(0,0,500,500)', 
  'TIFF', 'file', fileName, 'WORLDFILE', 'FILE', tfwName);
 
END;
/

The following example exports GeoRaster objects into BLOB and CLOB objects.

CREATE TABLE blob_table (blob_col BLOB, blobid NUMBER unique, clob_col CLOB);
INSERT INTO blob_table values (empty_blob(), 3, null);
INSERT INTO blob_table VALUES (empty_blob(), 4, empty_clob());
 
DECLARE
  lobd1 BLOB;
  lobd2 BLOB;
  lobd3 CLOB; 
  geor1 SDO_GEORASTER;
  geor2 SDO_GEORASTER;
 
BEGIN
 
-- Example 1: Export to BLOB.
SELECT blob_col INTO lobd1 FROM blob_table WHERE blobid=3 for update;
SELECT georaster INTO geor1 FROM georaster_table WHERE georid = 13;
sdo_geor.exportTo(geor1, '', 'TIFF', lobd1);
UPDATE blob_table set blob_col = lobd1 WHERE blobid=3;
COMMIT;
 
-- Example 2: Export GeoRaster to BLOB with world file exported to CLOB.
SELECT blob_col INTO lobd2 FROM blob_table WHERE blobid=4 for update;
SELECT clob_col INTO lobd3 FROM blob_table WHERE blobid=4 for update;
SELECT georaster INTO geor2 FROM georaster_table WHERE georid = 8;
sdo_geor.exportTo(geor2, 'cropArea=(0,0,500,500)', 'TIFF', lobd2,
  'WORLDFILE', lobd3);
UPDATE blob_table set blob_col = lobd2, clob_col = lobd3 WHERE blobid = 4;
COMMIT;
 
END;
/

SDO_GEOR.generateBlockMBR

Format

SDO_GEOR.generateBlockMBR(

     georaster IN SDO_GEORASTER);

Description

Computes the minimum bounding rectangle (MBR) for each block in a GeoRaster object, and sets the blockMBR attribute for each raster block in the raster data table.

Parameters

georaster

GeoRaster object.

Usage Notes

This procedure does not change the GeoRaster object. It sets the value of the blockMBR attribute (described in Section 2.2.6) in each row of the raster data table associated with the GeoRaster object.

If you created the GeoRaster object as described in Section 3.2, the blockMBR attribute values were automatically calculated and they should not need to be validated or generated. However, if the GeoRaster object was generated by a third party, you should validate the blockMBR attribute values using the SDO_GEOR.validateBlockMBR function; and if any are not valid, call the SDO_GEOR.generateBlockMBR procedure.

Examples

The following example computes the MBR for a specified GeoRaster object and sets its blockMBR attribute.

DECLARE
  gr sdo_georaster;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=1 FOR UPDATE;
  sdo_geor.generateBlockMBR(gr);
  COMMIT;
END;
/

SDO_GEOR.generatePyramid

Format

SDO_GEOR.generatePyramid(

     georaster IN OUT SDO_GEORASTER,

     pyramidParams IN VARCHAR2,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Generates pyramid data, which is stored together with the original data.

Parameters

georaster

GeoRaster object for which pyramid data is to be generated and stored.

pyramidParams

A string containing the pyramid parameters. See the Usage Notes for information about the available keywords and values.

bgValues

Background values for filling partially empty raster blocks. It is only useful when the source GeoRaster object has empty raster blocks and the current operation leads to partially empty raster blocks (see Section 1.4.4). The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filing value used for all bands) or the band dimension size (a different filling value for each band, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) fills the first band with 1, the second band with 5, and the third band with 10.

The filling values must be valid cell values as specified by the target cell depth background values for filling sparse data.

Usage Notes

For information about pyramid data, see Section 1.7.

pyramidParams must be a quoted string that contains one or more of the following keywords, each with an appropriate value:

  • rLevel (for example, rLevel=2): Specifies the maximum reduction level: the number of pyramid levels to create at a smaller (reduced) size than the original object. If you do not specify this keyword, pyramid levels are generated until the smaller of the number of rows or columns is between 64 and 128. The dimension sizes at each lower resolution level are equal to the truncated integer values of the dimension sizes at the next higher resolution level, divided by 2.

  • resampling (for example, resampling=NN): Specifies the resampling method. Must be one of the following: NN (value of the nearest neighbor cell in the original GeoRaster object), BILINEAR (distance-weighted average of the 4 nearest cells in the original GeoRaster object), AVERAGE4 (simple average of the 4 nearest cells in the original GeoRaster object), AVERAGE16 (simple average of the 16 nearest cells in the original GeoRaster object), CUBIC (cubic convolution of the 16 nearest cells in the original GeoRaster object).

  • nodata (for example, nodata=TRUE): Specifies whether NODATA values and value ranges should be considered during the procedure. Must be either TRUE (NODATA values and value ranges should be considered) or FALSE (NODATA values and value ranges should not be considered). The default value is FALSE. If the value is TRUE and the resampling method is BILINEAR, AVERAGE4, AVERAGE16 or CUBIC, whenever a cell value involved in the resampling calculation is a NODATA value, the result of the resampling is also a NODATA value. The resulting NODATA value is the minimum NODATA value associated with the current raster layer, if multiple NODATA values or value ranges exist.

If georaster is null or is a blank GeoRaster object, or if pyramid data exists for georaster but it was created with the same pyramid parameters specified in pyramidParams, this procedure performs no operation.

If pyramid data exists for georaster and it was created using different pyramid parameters from those specified in pyramidParams, the old pyramid data is deleted and new pyramid data is generated.

If you do not specify an rLevel value, the rLevel value is set to the default, which is calculated as follows:

(int)(log2(a / 64))

In the preceding calculation:

  • log2 is a logarithmic function with 2 as its base.

  • a is the smaller of the original row or column dimension size.

In the default case, the smaller of the row and column dimension sizes of the top-level overview (the smallest top-level pyramid) is between 64 and 128. If you specify an rLevel value greater than the maximum reduced-resolution level, the rLevel value is set to the maximum reduced-resolution level, which is calculated as follows:

(int)(log2(a))

In this case, the smaller of the row and column dimension sizes of the top-level overview is 1.

An exception is raised if georaster is invalid.

Examples

The following example creates pyramid data for a GeoRaster object.

DECLARE
  gr sdo_georaster;
BEGIN
 
  SELECT georaster INTO gr 
    FROM georaster_table WHERE georid = 6 FOR UPDATE;
 
  -- Generate pyramids.
  sdo_geor.generatePyramid(gr, 'rLevel=5, resampling=NN');
 
  -- Update the original GeoRaster object.
  UPDATE georaster_table SET georaster = gr WHERE georid = 6;
 
  COMMIT;
END;
/

SDO_GEOR.generateSpatialExtent

Format

SDO_GEOR.generateSpatialExtent(

     georaster IN SDO_GEORASTER,

     height IN NUMBER DEFAULT NULL

     ) RETURN SDO_GEOMETRY;

Description

Generates a Spatial geometry that contains the spatial extent (footprint) of the GeoRaster object.

Parameters

georaster

GeoRaster object.

height

Number specifying the Z value for three-dimensional (X, Y, Z) georeferencing.

Usage Notes

The returned SDO_GEOMETRY object is based on the model coordinate system of the GeoRaster object. If the GeoRaster object is not georeferenced, the SDO_GEOMETRY object has a null SDO_SRID value, which means the footprint geometry is in cell space; otherwise, the SDO_SRID value of the SDO_GEOMETRY object is the model SRID. Specifically:

  • If the GeoRaster object is not georeferenced or if the model coordinate system is projected, the spatial extent object is a single polygon derived from eight boundary points.

  • If the model coordinate system is geodetic, the spatial extent is densified according to the object's spatial footprint. If the area of the footprint is larger than half of the Earth's surface, the generated spatial extent object is a collection of geodetic polygons; otherwise, the result is a single geodetic polygon.

The footprint is automatically adjusted, based on the GeoRaster object's model coordinate location (CENTER or UPPERLEFT), to cover the whole area in the model space. CENTER is the default model coordinate location for non-georeferenced cases.

If the model coordinate system is three-dimensional, the generated spatial extent is a three-dimensional geometry. To build a spatial index based on the generated value, you may need to convert it into a two-dimensional geometry before saving it in the spatialExtent attribute of the GeoRaster object. For more information about cross-dimensionality transformations, see Oracle Spatial Developer's Guide.

This function does not set the spatial extent of the GeoRaster object (spatialExtent attribute, described in Section 2.1.2). For information about setting the spatial extent, see Section 3.6.

If georaster is null, this function returns a null SDO_GEOMETRY object. If georaster is not valid, an exception is raised.

Examples

The following example generates a three-dimensional spatial extent, with a Z or height dimension value of 10, in the geographic 3D coordinate system 4327 (the model SRID). (The output is slightly reformatted.)

SELECT SDO_GEOR.generateSpatialExtent(georaster,10) spatialExtent
  FROM georaster_table where georid=10;
 
SPATIALEXTENT(A.GEORASTER,10)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_IN
----------------------------------------------------------------------------------
SDO_GEOMETRY(3003, 4327, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(.181818182, 1.1627907, 10, 12.1228111, 1.07010227, 10, 19.3902574, 1.07010229, 10, 25.1482989, 1.07010229, 10, 30.0714774, 1.07010229,
10, 34.4500035, 1.07010229, 10, 38.3920079, 1.07010229, 10, 42.0490801,
1.07010229, 10, 45.4612165, 1.07010229, 10, 48.6719786, 1.07010229, 10,
53.6193472, 1.07010229, 10, 53.6193472, 12.346373, 10, 53.6178888, 15.3903048,
10, 53.6178888, 18.3032341, 10, 50.6322061, 18.3032341, 10, 47.5331761,
18.3032341, 10, 44.2541078, 18.3032341, 10, 40.7594212, 18.3032341, 10, 37,
18.3032341, 10, 32.9046537, 18.3032341, 10, 28.3630834, 18.3032341, 10,
23.1869539, 18.3032341, 10, 17, 18.3032341, 10, -2.220E-16, 18.3032341, 10, 0,
16.3247208, 10, -2.220E-16, 13.6133114, 10, .181818182, 1.1627907, 10))

The following examples return the spatial extent geometry of GeoRaster objects in the GEORASTER column of the GEORASTER_TABLE table. (They refer to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

SELECT sdo_geor.generateSpatialExtent(georaster) spatialExtent
  FROM georaster_table WHERE georid=2;
 
SPATIALEXTENT(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINA
--------------------------------------------------------------------------------
 
SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARR
AY(0, 0, 256, 0, 511, 0, 511, 256, 511, 511, 256, 511, 0, 511, 0, 256, 0, 0))
 
SET NUMWIDTH 20
SELECT sdo_geor.generateSpatialExtent(georaster) spatialExtent
  FROM georaster_table WHERE georid=4;
 
SPATIALEXTENT(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO,
SDO_ORDINA
--------------------------------------------------------------------------------
 
SDO_GEOMETRY(2003, 82263, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_AR
RAY(1828466.0909315, 646447.1932945, 1828466.0909315, 644479.85524, 1828466.0909
315, 642512.5171855, 1830433.428986, 642512.5171855, 1832400.7670405, 642512.517
1855, 1832400.7670405, 644479.85524, 1832400.7670405, 646447.1932945, 1830433.42
8986, 646447.1932945, 1828466.0909315, 646447.1932945))

SDO_GEOR.generateStatistics

Format

SDO_GEOR.generateStatistics(

     georaster IN OUT SDO_GEORASTER,

     samplingFactor IN VARCHAR2,

     samplingWindow IN SDO_NUMBER_ARRAY,

     histogram IN VARCHAR2,

     layerNumbers IN VARCHAR2 DEFAULT NULL,

     useBin IN VARCHAR2 DEFAULT 'TRUE',

     binFunction IN MDSYS.SDO_NUMBER_ARRAY DEFAULT NULL,

     nodata IN VARCHAR2 DEFAULT 'FALSE'

     ) RETURN VARCHAR2;

or

SDO_GEOR.generateStatistics(

     georaster IN OUT SDO_GEORASTER,

     samplingFactor IN VARCHAR2,

     samplingWindow IN SDO_GEOMETRY,

     histogram IN VARCHAR2,

     layerNumbers IN VARCHAR2 DEFAULT NULL,

     useBin IN VARCHAR2 DEFAULT 'TRUE',

     binFunction IN MDSYS.SDO_NUMBER_ARRAY DEFAULT NULL,

     nodata IN VARCHAR2 DEFAULT 'FALSE'

     ) RETURN VARCHAR2;

Description

Computes and sets statistical data associated with one or more layers.

Parameters

georaster

GeoRaster object.

samplingFactor

Sampling factor in the format 'samplingFactor=n', with the denominator n in 1/(n*n) representing the number of cells skipped in both row and column dimensions in computing the statistics. For example, if samplingFactor is 4, one-sixteenth of the cells are sampled; but if samplingFactor is 1, all cells are sampled. The higher the value, the less accurate the statistics are likely to be, but the more quickly they will be computed.

samplingWindow

Sampling window: a rectangular window for which to set statistics, specified either as a numeric array with the lower-left and upper-right coordinates or as an SDO_GEOMETRY object. The SDO_NUMBER_ARRAY type is defined as VARRAY(1048576) OF NUMBER. The window must be inside the extent in cell space. The default for this parameter is the entire image.

histogram

Specify TRUE to cause a histogram to be computed and stored, or FALSE to cause a histogram not to be computed and stored. Histograms are discussed in Section 2.3.1. The XML definitions of the <histogram> element and the histogramType complex type are included in Appendix A.

layerNumbers

Numbers of the layers for which to compute the statistics. This is a string that can include numbers, number ranges indicated by hyphens (-), and commas to separate numbers and number ranges. For example, '1,3-5,7' specifies layers 1, 3, 4, 5, and 7. Layer 0 (zero) indicates the object layer.

useBin

Specifies whether or not to use a provided bin function (specified in the binFunction parameter) when generating statistics. TRUE (the default) causes a bin function to be used as follows: (1) the bin function specified by the binFunction parameter, if it is not null; otherwise, (2) the bin function specified by the <binFunction> element in the GeoRaster XML metadata, if one is specified; otherwise, (3) a dynamically generated bin function, as explained in the Usage Notes. FALSE causes a dynamically generated bin function to be used, and causes the binFunction parameter and <binFunction> element to be ignored.

For information about bin functions, see the Usage Notes for the SDO_GEOR.setBinFunction procedure.

binFunction

Bin function as an array whose elements specify the bin type, total number of bins, first bin number, minimum cell value, and maximum cell value. The SDO_NUMBER_ARRAY type is defined as VARRAY(1048576) OF NUMBER. For more information about the bin function for SQO_GEOR.generateStatistics, see the Usage Notes. For information about bin functions and an example, see the Usage Notes for the SDO_GEOR.setBinFunction procedure.

nodata

Specifies whether or not to compare each cell values with NODATA values defined in the metadata when computing statistics. TRUE causes all pixels with a NODATA value not to be considered; FALSE (the default) causes pixels with NODATA values to be considered as regular pixels. NODATA values and value ranges are discussed in Section 1.9.

Usage Notes

This function computes and sets the statistical data described by the <statisticDatasetType> element in the GeoRaster metadata XML schema, which is described in Appendix A.

If histogram is TRUE, this function determines the range of each bin based on the bin function being used, and within each range it computes the count of each pixel value. The histogram and the bin function are related as follows: each bin is mapped to a (value, count) pair of the histogram, and the lower boundary of each bin is mapped to corresponding value of histogram (value, count) pair, with the following exceptions:

  • If Min_r < Min, then one more pair (Min_r, count) is added as the first pair of the histogram. (Min_r is the real minimum value of the data set computed by this function, and Min is the min value specified in the bin function.)

  • If Max_r > Max, then one more pair (Max_r, count) is added as the last pair of the histogram. (Max_r is the real maximum value of the data set computed by this function, and Max is the max value specified in the bin function.)

  • Leading and trailing count=0 pairs in the histogram are suppressed. For example:

    (1,0) (2,0) (3,11) (4,12) becomes (3,11) (4,12)
    (1,11) (2,12) (3,0) (4,0) becomes (1,11) (2,12)
    

If histogram is TRUE, any existing histogram in the XML metadata is replaced by the new generated histogram.

SQO_GEOR.generateStatistics supports only LINEAR bin functions (binType = 0), not LOGARITHM or EXPLICIT bin functions. (The XML definitions of all bin function types are in Appendix A.) If the useBin parameter value is FALSE, this function ignores any binFunction parameter value and any <binFunction> element in the GeoRaster XML metadata, and it uses a LINEAR bin function in which the min and max values are the actual minimum and maximum values of the data set, and the numbins value depends on the cell depth, as follows:

  • If cellDepth = 1, numbins = 2.

  • If cellDepth = 2, numbins = 4.

  • If cellDepth = 4, numbins = 8.

  • If cellDepth >= 8, numbins = 256.

If the useBin parameter value is TRUE, this function uses a bin function as follows:

  1. If the binFunction parameter specifies a valid bin function, it is used.

  2. Otherwise, if a valid bin function is defined in the GeoRaster metadata, it is used.

  3. Otherwise, the same bin function is used as when the useBin parameter value is FALSE.

Contrast this function, which causes GeoRaster to compute and set the statistics, with the SDO_GEOR.setStatistics procedure, in which you specify the statistics to be set.

To retrieve the statistical data associated with a layer, use the SDO_GEOR.getStatistics function.

Examples

The following example generates the statistical data and a histogram.

DECLARE
  gr SDO_GEORASTER;
  ret VARCHAR2(256);
  window SDO_NUMBER_ARRAY := SDO_NUMBER_ARRAY(20,10,50,50);
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=1 FOR UPDATE;
  SDO_GEOR.setBinFunction(gr,1,sdo_number_array(0,10,1,50,200));
  ret := SDO_GEOR.generateStatistics(gr, 'samplingFactor=5', window, 'TRUE',
    '1-1', 'TRUE');
  UPDATE georaster_table SET georaster=gr WHERE georid=1;
  COMMIT;
END;
/

SDO_GEOR.georeference

Format

SDO_GEOR.georeference(

     georaster IN OUT SDO_GEORASTER,

     srid IN NUMBER,

     modelCoordinateLocation IN NUMBER,

     xCoefficients IN SDO_NUMBER_ARRAY,

     yCoefficients IN SDO_NUMBER_ARRAY);

Description

Georeferences a GeoRaster object using specified cell-to-model transformation coefficients.

Parameters

georaster

The SDO_GEORASTER object to be georeferenced.

srid

Model coordinate system. Must not be null or 0 (zero). It can be a value from the SRID column of the MDSYS.CS_SRS table. If it is not a value from the SRID column of the MDSYS.CS_SRS table, the SRID is not supported by Oracle Spatial, and some SRID-related operations may not be supported.

modelCoordinateLocation

A value specifying the model location of the base of the area represented by a cell: 0 for CENTER or 1 for UPPERLEFT.

xCoefficients

An array specifying the A, B, and C coefficient values in the calculation, as explained in the Usage Notes.

yCoefficients

An array specifying the D, E, and F coefficient values in the calculation, as explained in the Usage Notes.

Usage Notes

Use this procedure to georeference a GeoRaster object based on an existing affine transformation. Georeferencing is explained in Section 1.6 and Section 3.5.

This procedure assumes that in the original georeferencing information in the source data, such as in an ESRI world file, the transformation formulas are the following:

x = A * column + B * row + C
y = D * column + E * row + F

Specify the preceding A, B, C, D, E, and F coefficients to the SDO_GEOR.georeference procedure. They are automatically adjusted internally to produce the correct georeferencing result: a, b, c, d, e, and f coefficients, as in the following formulas:

row    = a + b * x + c * y
column = d + e * x + f * y

In these formulas:

  • row = Row index of the cell in raster space.

  • column = Column index of the cell in raster space.

  • x = East-West position of the point on the ground or in model space.

  • y = North-South position of the point on the ground or in model space.

  • a, b, c, d, e, and f are coefficients, and they are stored in the GeoRaster SRS metadata.

  • b*f – c*e should not be equal to 0 (zero).

In these formulas, if b = 0, f = 0, c = -e, and both c and e are not 0 (zero), the raster data is called rectified, and the formula becomes:

row    = a + c * y
column = d - c * x

This procedure sets the spatial resolutions of the GeoRaster object.

The following also perform operations related to georeferencing:

  • The SDO_GEOR.setSRS procedure sets or deletes georeferencing information.

  • The SDO_GEOR.importFrom procedure can load an ESRI world file or a Digital Globe RPC file from a file or from a CLOB object. It also loads geometadata from a GeoTIFF file.

  • The GeoRaster loader tool (described in Section 1.13) can load an ESRI world file, a Digital Globe RPC file, or a GeoTIFF file.

Examples

The following example georeferences a GeoRaster object, and it calls the SDO_GEOR.getSRS function to retrieve information related to the spatial referencing of the object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  gr sdo_georaster;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid = 1 FOR UPDATE;
  sdo_geor.georeference(gr, 82394, 1,
                        sdo_number_array(28.5, 0, 1232804.04),
                        sdo_number_array(0, -28.5, 13678.09));
  UPDATE georaster_table SET georaster = gr WHERE georid = 1;
  COMMIT;
END;
/
 
PL/SQL procedure successfully completed.
 
SET NUMWIDTH 20
SELECT georid, sdo_geor.getSRS(georaster) SRS FROM georaster_table
  WHERE georid = 1;
 
              GEORID
--------------------
SRS(ISREFERENCED, ISRECTIFIED, ISORTHORECTIFIED, SRID,
SPATIALRESOLUTION, SPATIA
--------------------------------------------------------------------------------
 
                   1
SDO_GEOR_SRS('TRUE', 'TRUE', NULL, 82394, SDO_NUMBER_ARRAY(28.5, 28.5), NULL, NU
LL, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, NULL, NULL, NULL, SDO_NUMBER_ARRAY(1, 2, 1, 3,
 479.93298245614, 0, -.0350877192982456), SDO_NUMBER_ARRAY(1, 0, 0, 1, 1), SDO_N
UMBER_ARRAY(1, 2, 1, 3, -43256.2821052632, .0350877192982456, 0), SDO_NUMBER_ARR
AY(1, 0, 0, 1, 1))

SDO_GEOR.getBandDimSize

Format

SDO_GEOR.getBandDimSize(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the number of bands in a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

For an explanation of bands, see Section 1.5.

If georaster or its metadata is null, this function returns a null value.

Examples

The following example returns the spatial dimension sizes and the number of bands (one in this case) for a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1. The output is reformatted for readability.)

SELECT sdo_geor.getSpatialDimSizes(georaster) spatialDimSizes,
       sdo_geor.getBandDimSize(georaster) bandDimSize
  FROM georaster_table WHERE georid=21;

SPATIALDIMSIZES                  BANDDIMSIZE
--------------------------       -----------
SDO_NUMBER_ARRAY(512, 512)           1

SDO_GEOR.getBeginDateTime

Format

SDO_GEOR.getBeginDateTime(

     georaster IN SDO_GEORASTER

     ) RETURN TIMESTAMP WITH TIME ZONE;

Description

Returns the beginning date and time for raster data collection in the metadata for a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

To set the beginning date and time for raster data collection in the metadata for a GeoRaster object, use the SDO_GEOR.setBeginDateTime procedure.

If georaster or its metadata is null, this function returns a null value.

Examples

The following example returns the beginning and ending dates and times for raster data collection in the metadata for the GeoRaster object in a table named GEORASTER_TABLE where the GEORID column contains the value 4. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

SELECT sdo_geor.getBeginDateTime(georaster) beginDateTime,
  sdo_geor.getEndDateTime(georaster) endDateTime
  FROM georaster_table WHERE georid=4;
 
BEGINDATETIME
---------------------------------------------------------------------------
ENDDATETIME
---------------------------------------------------------------------------
01-JAN-00 05.00.00.000000000 AM +00:00
15-NOV-02 08.00.00.000000000 PM +00:00

SDO_GEOR.getBinFunction

Format

SDO_GEOR.getBinFunction(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN SDO_NUMBER_ARRAY;

Description

Gets the bin function associated with a layer.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the bin type. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns the bin function as an array whose elements specify the bin type, total number of bins, first bin number, minimum cell value, and maximum cell value. The SDO_NUMBER_ARRAY type is defined as VARRAY(1048576) OF NUMBER.

If the bin type is EXPLICIT, an external bin table is used and this function returns a null value.

For a more detailed explanation of the bin function format, see the Usage Notes for the SDO_GEOR.setBinFunction procedure.

An exception is raised if layerNumber is null, negative, or greater than the maximum layer number.

Examples

The following example gets the bin function for layer 3 of a specified GeoRaster object.

SELECT sdo_geor.getBinFunction(georaster,3) FROM georaster_table WHERE georid=4;
 
SDO_GEOR.GETBINFUNCTION(GEORASTER,3)
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(0, 10, 1, 0, 511)

SDO_GEOR.getBinTable

Format

SDO_GEOR.getBinTable(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Returns the name of the bin table associated with a layer.

Note:

GeoRaster does not perform operations using the bin table in the current release.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the bin table name. A value of 0 (zero) indicates the object layer.

Usage Notes

This function is relevant only if the bin type is EXPLICIT. To retrieve the bin type, use the SDO_GEOR.getBinType function.

To specify a bin table for a layer, use the SDO_GEOR.setBinTable procedure.

See also the information in the Usage Notes for the SDO_GEOR.getBinType function.

If georaster or its metadata is null, this function returns a null value.

An exception is raised if layerNumber is null, negative, or greater than the maximum layer number.

Examples

The following example returns the name of the bin table for layer number 4 of a specified GeoRaster object in a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT sdo_geor.getBinTable(georaster, 4) FROM georaster_table WHERE georid=4;

SDO_GEOR.getBinType

Format

SDO_GEOR.getBinType(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Returns the bin type associated with a layer.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the bin type. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns one of the following bin type values: LINEAR, LOGARITHM, or EXPLICIT.

The LINEAR bin type is defined as follows:

binNumber = numbins * (cellValue - min) / (max - min) + firstBinNumber
if (binNumber less than 0) binNumber =  firstBinNumber
if (binNumber greater than or equal to numbins) binNumber = numbins + firstBinNumber - 1

The LOGARITHM bin type is defined as follows:

binNumber = numbins * (ln (1.0 + ((cellValue - min)/(max - min)))/ ln (2.0)) + firstBinNumber
if (binNumber less than 0) binNumber =  firstBinNumber
if (binNumber greater than or equal to numbins) binNumber = numbins + firstBinNumber - 1

The EXPLICIT bin type means that the value (or value range) for each bin is stored in a bin table (which you can set using the SDO_GEOR.setBinTable procedure and retrieve using the SDO_GEOR.getBinTable function).

A bin function maps values or value ranges of the GeoRaster cells to specific bin numbers, which are all integers. GeoRaster does not provide interfaces to manipulate and process bin functions.

If georaster or its metadata is null, this function returns a null value.

An exception is raised if layerNumber is null, negative, or greater than the maximum layer number.

Examples

The following example returns the bin types for layers 0 and 1 of a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1. The output is reformatted for readability.)

SELECT substr(sdo_geor.getBinType(georaster, 0),1,20) binType0,
       substr(sdo_geor.getBinType(georaster, 1),1,20) binType1
  FROM georaster_table WHERE georid=4;
 
BINTYPE0        BINTYPE1
--------------- ---------------
EXPLICIT        LINEAR

SDO_GEOR.getBitmapMask

Format

SDO_GEOR.getBitmapMask(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER,

     storageParam IN VARCHAR2,

     mask IN OUT SDO_GEORASTER);

Description

Gets the bitmap mask that is associated with a GeoRaster object or a layer in a GeoRaster object.

Parameters

georaster

GeoRaster object.

layerNumber

The layer on which to perform the operation. A value of 0 (zero) indicates the object layer.

storageParam

A string specifying storage parameters, as explained in Section 1.4.1.

mask

The resulting GeoRaster object to hold the bitmap mask. Must be either a valid existing GeoRaster object or an empty GeoRaster object. (Empty GeoRaster objects are explained in Section 1.4.3.) Cannot be the same GeoRaster object as the input GeoRaster object (georaster parameter).

Usage Notes

If no bitmap mask is associated with the specified layer of the GeoRaster object, the resulting GeoRaster object is not updated.

If the storageParam parameter is null, the resulting GeoRaster object has a celldepth value of 1BIT celldepth, has DEFLATE compression if the input GeoRaster object is compressed, and has the same interleaving type and blocking size as the input GeoRaster object. It also contains all the bitmap mask pyramids if the input GeoRaster object has pyramids built on it.

A bitmap mask may have empty raster blocks (see Section 1.4.4). If there is reblocking that leads to partially empty raster blocks, any cells in a partially empty block that are derived from an empty raster block are filled with the value 0 (zero).

For an explanation of bitmap masks, see Section 1.8.

Examples

The following example retrieves the bitmap mask associated with the object layer of the specified GeoRaster object.

DECLARE
  gr sdo_georaster;
  mk sdo_georaster;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=4;
  INSERT INTO georaster_table (georid, georaster)
    VALUES (100, sdo_geor.init('rdt_1', 100))
    RETURNING georaster INTO mk;
  sdo_geor.getBitmapMask(gr, 0, 'compression=none', mk);
  UPDATE georaster_table SET georaster=mk WHERE georid=100;
  COMMIT;
END;
/

SDO_GEOR.getBitmapMaskSubset

Format

SDO_GEOR.getBitmapMaskSubset(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER,

     pyramidLevel IN VARCHAR2,

     window IN SDO_NUMBER_ARRAY,

     rasterBlob IN OUT NOCOPY BLOB,

     storageParam IN VARCHAR2 DEFAULT NULL);

or

SDO_GEOR.getBitmapMaskSubset(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER,

     pyramidLevel IN VARCHAR2,

     inWindow IN SDO_NUMBER_ARRAY,

     rasterBlob IN OUT NOCOPY BLOB,

     outWindow OUT SDO_NUMBER_ARRAY,

     storageParam IN VARCHAR2 DEFAULT NULL);

or

SDO_GEOR.getBitmapMaskSubset(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER,

     pyramidLevel IN VARCHAR2,

     window IN SDO_GEOMETRY,

     rasterBlob IN OUT NOCOPY BLOB,

     storageParam IN VARCHAR2 DEFAULT NULL);

or

SDO_GEOR.getBitmapMaskSubset(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER,

     pyramidLevel IN VARCHAR2,

     inWindow IN SDO_GEOMETRY,

     rasterBlob IN OUT NOCOPY BLOB,

     outWindow OUT SDO_NUMBER_ARRAY,

     storageParam IN VARCHAR2 DEFAULT NULL);

Description

Gets a subset of a bitmap mask.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer on which to perform the operation. A value of 0 (zero) indicates the object layer.

pyramidLevel

Pyramid level containing the specified cell.

window, inWindow

A rectangular window for the subset, specified either as a numeric array with the lower-left and upper-right coordinates or as an SDO_GEOMETRY object. The SDO_NUMBER_ARRAY type is defined as VARRAY(1048576) OF NUMBER.

rasterBlob

BLOB to hold the output (the resulting subset).

outWindow

An SDO_NUMBER_ARRAY object identifying the coordinates of the upper-left and lower-right corners of the output window in the cell space

storageParam

A string specifying storage parameters to be applied in creating rasterBlob. The only storageParam keywords supported for this procedure are celldepth, compression, interleaving, and quality; all other keywords are ignored. Storage parameters are explained in Section 1.4.1.

If the storageParam parameter is null, the resulting GeoRaster object has a celldepth value of 1BIT celldepth, has DEFLATE compression if the input GeoRaster object is compressed, and has the same interleaving type as the input GeoRaster object.

Usage Notes

If there is no bitmap associated with the specified GeoRaster object at the specified raster layer, or the specified input window does not intersect with the spatial extent of the GeoRaster object, the procedure returns with rasterBlob truncated to length zero and the outWindow set to a null value.

This procedure operates on a single GeoRaster object. The procedure has four formats, depending on whether the input window is specified as a geometry object or as the upper-left and lower-right corners of a box, and on whether the outWindow parameter is used to return the coordinates of the output window.

If the window or inWindow parameter data type is SDO_GEOMETRY, the SDO_SRID value must be one of the following: null (to specify raster space) or a value from the SRID column of the MDSYS.CS_SRS table.

If the SDO_SRID values for the window or inWindow parameter geometry and the model space are different, the geometry parameter is automatically transformed to the coordinate system of the model space before the operation is performed. (Raster space and model space are explained in Section 1.3.)

If the window parameter specifies a geodetic MBR, it cannot cross the date line meridian. For information about geodetic MBRs, see Oracle Spatial Developer's Guide.

After the procedure completes, the rasterBLOB parameter contains the cell (pixel) data in the cropped window without tiling. The cropped window is the overlapping portion of the specified window of interest and the source GeoRaster object's spatial extent. If the outWindow parameter is specified, after the procedure completes it contains the coordinates of the cropped window in the cell space.

A bitmap mask may have empty raster blocks (see Section 1.4.4). Any cells in the output window that are derived from an empty raster block are filled with the value 0 in the output BLOB.

The BLOB has no padding, except when the cell depth is less than 8 bits and the total number of bits needed for the output cannot be divided by 8; in these cases, unlike normal padding, only the last byte of the result is padded with 0 (zeros) for the trailing bits.

You can specify compression regardless of whether the input GeoRaster object is compressed or not. To have decompressed output for a compressed input GeoRaster object, specify compression=NONE in the storageParam parameter. For information about GeoRaster compression and decompression, see Section 1.10.

For an explanation of bitmap masks, see Section 1.8.

Examples

The following example retrieves a subset of a bitmap mask associated with the object layer of a specified GeoRaster object.

DECLARE
  gr sdo_georaster;
  lb blob;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=4;
  dbms_lob.createTemporary(lb, TRUE);
  sdo_geor.getBitmapMaskSubset(gr, 0, 0, sdo_number_array(0,0,99,99), lb, 'compression=none');
  dbms_lob.freeTemporary(lb);
END;
/

SDO_GEOR.getBitmapMaskValue

Format

SDO_GEOR.getBitmapMaskValue(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER,

     pyramidLevel IN VARCHAR2,

     rowNumber IN NUMBER,

     colNumber IN NUMBER

     ) RETURN NUMBER;

or

SDO_GEOR.getBitmapMaskValue(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER,

     pyramidLevel IN VARCHAR2,

     ptGeom IN SDO_GEOMETRY

     ) RETURN NUMBER;

Description

Gets the value of a single cell from a bitmap mask.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer on which to perform the operation. A value of 0 (zero) indicates the object layer.

pyramidLevel

Pyramid level containing the specified cell.

rowNumber

Row number in cell space.

colNumber

Column number in cell space.

ptGeom

Point geometry in cell space or model space.

Usage Notes

You can specify the cell by its row and column numbers or by a point geometry object.

If there is no bitmap associated with the specified GeoRaster object at the specified raster layer, or the specified cell is in an empty raster block, the function returns a null value.

For an explanation of bitmap masks, see Section 1.8.

Examples

The following example gets the value of four cells from the bitmap mask associated with a specified GeoRaster object.

SELECT sdo_geor.getBitmapMaskValue(georaster,0,0,0,0) c1,
       sdo_geor.getBitmapMaskValue(georaster,0,0,9,9) c2,
       sdo_geor.getBitmapMaskValue(georaster,0,0,9,10) c3,
       sdo_geor.getBitmapMaskValue(georaster,0,0,10,9) c4
  FROM georaster_table WHERE georid=0;

SDO_GEOR.getBlankCellValue

Format

SDO_GEOR.getBlankCellValue(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the cell value for all cells if a specified GeoRaster object is a blank GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

In a blank GeoRaster object, all cells have the same cell value. This function returns the cell value for all cells if the specified GeoRaster object is a blank GeoRaster object.

To set the cell value to be used if a specified GeoRaster object is a blank GeoRaster object, use the SDO_GEOR.setBlankCellValue procedure. To determine if a specified GeoRaster object is a blank GeoRaster object, use the SDO_GEOR.isBlank function.

If georaster is null, invalid, or is not a blank GeoRaster object, the SDO_GEOR.getBlankCellValue function returns a null value.

Examples

The following example returns the blank cell values for all blank GeoRaster objects in the GEORASTER column of table GEORASTER_TABLE.

SELECT georid, sdo_geor.getBlankCellValue(georaster) blankValue
  FROM georaster_table WHERE sdo_geor.isBlank(georaster)='TRUE';

    GEORID BLANKVALUE
---------- ----------
         1        255
         2        155

SDO_GEOR.getBlockingType

Format

SDO_GEOR.getBlockingType(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the blocking type for a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

This function returns one of the following values: NONE or REGULAR:

  • NONE means that the GeoRaster object is not blocked, but is a single BLOB object.

  • REGULAR means that the GeoRaster object uses regular blocking, that is, each block has the same dimension sizes.

If georaster or its metadata is null, this function returns a null value.

Examples

The following example returns the cell depth, interleaving type, and blocking type 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 Section 1.4.1.

SELECT sdo_geor.getCellDepth(georaster) CellDepth,
       substr(sdo_geor.getInterleavingType(georaster),1,8) interleavingType,
       substr(sdo_geor.getBlockingType(georaster),1,8) blocking
  FROM georaster_table WHERE georid=21;

 CELLDEPTH INTERLEA BLOCKING
---------- -------- --------
         8 BSQ      REGULAR

SDO_GEOR.getBlockSize

Format

SDO_GEOR.getBlockSize(

     georaster IN SDO_GEORASTER

     ) RETURN SDO_NUMBER_ARRAY;

Description

Returns the number of cells for each dimension in each block of a GeoRaster object in an array showing the number of cells for each row, column, and (if relevant) band.

Parameters

georaster

GeoRaster object.

Usage Notes

If georaster or its metadata is null, or if georaster is not blocked, this function returns a null value.

Examples

The following example returns the number of cells (512 in each dimension) in each block 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 Section 1.4.1.

SELECT sdo_geor.getBlockSize(georaster) blockSize
   FROM georaster_table WHERE georid=21;

BLOCKSIZE
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(512, 512)

SDO_GEOR.getCellCoordinate

Format

SDO_GEOR.getCellCoordinate(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     modelCoordinate IN SDO_GEOMETRY,

     subCell IN VARCHAR2 DEFAULT NULL,

     height IN NUMBER DEFAULT NULL,

     vert_id IN NUMBER DEFAULT NULL,

     ellipsoidal IN VARCHAR2 DEFAULT NULL

     ) RETURN SDO_NUMBER_ARRAY;

or

SDO_GEOR.getCellCoordinate(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     modelCoordinate IN SDO_GEOMETRY,

     cellCoordinate OUT MDSYS.SDO_GEOMETRY,

     subCell IN VARCHAR2 DEFAULT NULL,

     height IN NUMBER DEFAULT NULL,

     vert_id IN NUMBER DEFAULT NULL,

     ellipsoidal IN VARCHAR2 DEFAULT NULL);

or

SDO_GEOR.getCellCoordinate(

     georaster IN SDO_GEORASTER,

     sourcePyramidLevel IN NUMBER,

     sourceCellCoordinate IN SDO_NUMBER_ARRAY,

     targetPyramidLevel IN NUMBER,

     subCell IN VARCHAR2 DEFAULT NULL,

     ) RETURN SDO_NUMBER_ARRAY;

or

SDO_GEOR.getCellCoordinate(

     georaster IN SDO_GEORASTER,

     sourcePyramidLevel IN NUMBER,

     sourceCellCoordinate IN SDO_GEOMETRY,

     targetPyramidLevel IN NUMBER,

     subCell IN VARCHAR2 DEFAULT NULL,

     ) RETURN SDO_GEOMETRY;

Description

Returns the coordinates in the cell (raster) coordinate system associated with the geometry at the specified model (ground) coordinates (first two formats), or converts cell coordinates between pyramid levels (last two formats).

Note that the second format is a procedure; the other formats are functions.

Parameters

georaster

GeoRaster object.

pyramidLevel

Pyramid level containing the cell specified in modelCoordinate.

modelCoordinate

The geometry that is to be converted.

cellCoordinate

The output geometry in the cell space of the GeoRaster object.

sourcePyramidLevel (last two formats)

Pyramid level with which the input cell coordinate is associated.

sourceCellCoordinate (last two formats)

Input cell coordinates to be converted. Must be a two-dimensional geometry, and its SDO_SRID value must be null.

targetPyramidLevel (last two formats)

Pyramid level of the returned (target) GeoRaster object.

subCell

String (TRUE or FALSE) specifying whether to return the cell coordinates in sub-pixel (floating) values.

height

Number specifying the Z value for three-dimensional (X, Y, Z) georeferencing.

vert_id

Number specifying the vertical reference ID.

ellipsoidal

String specifying whether the vertical reference system is ellipsoidal (TRUE) or not ellipsoidal (FALSE).

Usage Notes

The first two formats of this function return the coordinates in the cell (raster) coordinate system associated with the geometry at the specified model (ground) coordinates:

  • Use the first format (a function without the cellCoordinate parameter) to transform a point in the ground coordinate system (a longitude, latitude pair) to the location of a point on the GeoRaster image.

  • Use the second format (a procedure with the cellCoordinate parameter) to transform a geometry in the ground coordinate system to the location of a geometry in the raster space of the GeoRaster object. The conversion is done by converting the coordinates of each vertex of the input geometry from the ground coordinate system to the raster space of the GeoRaster object.

The last two formats of this function convert cell coordinates between pyramid levels. If the type of the sourceCellCoordinate parameter is SDO_NUMBER_ARRAY, it specifies the <row,column> pair for a point in the cell space at the source pyramid level. If the type of the sourceCellCoordinate parameter is SDO_GEOMETRY, it specifies a geometry in the cell space at the source pyramid level. The coordinates of each vertex of the input geometry are converted according to the specified pyramid levels.

  • Use the first format (without the cellCoordinate parameter) to transform a point in the ground coordinate system (a longitude, latitude pair) to the location of a point on the GeoRaster image.

  • Use the second format (with the cellCoordinate parameter) to transform a geometry in the ground coordinate system to the location of a geometry in the raster space of the GeoRaster object. The conversion is done by converting the coordinates of each vertex of the input geometry from the ground coordinate system to the raster space of the GeoRaster object.

If the SDO_SRID value of the modelCoordinate geometry is null, the parameter specifies a geometry in the raster space; otherwise, it specifies a point in a ground coordinate system. If the ground coordinate system is different from the model coordinate system, the modelCoordinate parameter geometry is automatically transformed to the coordinate system of the model space before the operation is performed.

Contrast this function with SDO_GEOR.getModelCoordinate, which returns a point geometry containing the coordinates in the model (ground) coordinate system associated with the point at the specified cell coordinates.

Examples

The following example returns the cell coordinates in the raster image associated with model coordinate values (32343.64,7489527.23) in a specified GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

SELECT sdo_geor.getCellCoordinate(georaster, 0, sdo_geometry(2001,82394,
  sdo_point_type(32343.64,7489527.23,null), null,null)) coord
FROM georaster_table WHERE georid=4;
 
COORD
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(100, 100)

The following example returns the geometry at pyramid level 0 that is associated with the specified geometry at pyramid level 2, assuming the geometry is not georeferenced (the model coordination location is CENTER) and the ultCoordinate is (100,-100,0).

SELECT sdo_geor.getCellCoordinate(georaster, 2, 
                sdo_geometry(2003,NULL,NULL,sdo_elem_info_array(1,1003,3),
                             sdo_ordinate_array(100.8,-100.2,220.15,0.3)), 
                0, 'true') coord
FROM georaster_table WHERE georid=1;
 
COORD
--------------------------------------------------------------------------------
SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 3), SDO_ORDINATE_ARR
AY(104.7, -99.3, 582.1, 302.7))

SDO_GEOR.getCellDepth

Format

SDO_GEOR.getCellDepth(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the cell depth in bits.

Parameters

georaster

GeoRaster object.

Usage Notes

The cell depth determines the precision and the data size of an image. As the cell depth value decreases, less disk space is needed to store the image; as the cell depth value increases, more disk space is needed to store the image.

To return the cell depth as a string (such as 32BIT_S) instead of a number, you can use the XMLType PL/SQL interface extract. The possible string values are listed in the cellDepthType definition in the GeoRaster metadata XML schema, which is described in Appendix A. The following example returns a string value for the cell depth of the GeoRaster object with the GEORID column value of 21 in the GEORASTER_TABLE table:

SELECT t.georaster.metadata.extract(
         '/georasterMetadata/rasterInfo/cellDepth/text()',
         'xmlns=http://xmlns.oracle.com/spatial/georaster')
  FROM georaster_table t WHERE t.georid=21;

Examples

The following example returns the cell depth, interleaving type, and blocking type 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 Section 1.4.1.

SELECT sdo_geor.getCellDepth(georaster) CellDepth,
       substr(sdo_geor.getInterleavingType(georaster),1,8) interleavingType,
       substr(sdo_geor.getBlockingType(georaster),1,8) blocking
  FROM georaster_table WHERE georid=21;

 CELLDEPTH INTERLEA BLOCKING
---------- -------- --------
         8 BSQ      REGULAR

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,

     ptGeom IN SDO_GEOMETRY,

     layerNumber IN NUMBER

     ) RETURN NUMBER;

Description

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

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.

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 Section 1.5, 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 of cell values. 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 Section 1.4.1.

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

SDO_GEOR.getColorMap

Format

SDO_GEOR.getColorMap(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN SDO_GEOR_COLORMAP;

Description

Returns the colormap for pseudocolor display of a layer in a GeoRaster object.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the colormap. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns an object of type SDO_GEOR_COLORMAP. Section 2.3.2 describes colormaps and this object type.

To set the colormap for a layer in a GeoRaster object, use the SDO_GEOR.setColorMap procedure.

If georaster or its metadata is null, this function returns a null value.

An exception is raised if layerNumber is null, negative, or greater than the maximum layer number.

Examples

The following example returns the colormap for layer 1 of a GeoRaster object. (Part of the output is omitted.)

SELECT sdo_geor.getColorMap(georaster, 1) FROM georaster_table
   WHERE georid = 4;
 
SDO_GEOR.GETCOLORMAP(GEORASTER,1)(CELLVALUE, RED, GREEN, BLUE, ALPHA)
--------------------------------------------------------------------------------
SDO_GEOR_COLORMAP(SDO_NUMBER_ARRAY(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158,
159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238,
239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
255), SDO_NUMBER_ARRAY(180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 18
0, 127, 127, 100, 50, 50, 127, 159, 191, 223, 255, 255, 255, 255, 218, 182, 145,
 109, 72, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 36, 72, 109, 145, 182, 218, 255, 200, 206, 212, 218, 224, 230, 236, 242,
248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255), SDO_NUMBER_ARRAY(127, 127,
127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 180, 127, 50, 100, 50, 127,
159, 191, 223, 255, 200, 150, 100, 122, 144, 166, 188, 210, 232, 255, 255, 255,
248, 241, 234, 227, 220, 213, 206, 200, 150, 100, 87, 75, 62, 50, 37, 25, 12, 0,
200, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 85, 113, 141, 170, 198, 226, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255), SDO_NUMBER_ARRAY(127, 127, 127, 127,
127, 127, 127, 127, 127, 127, 127, 127, 127, 180, 50, 50, 100, 127, 95, 63, 31,
0, 0, 0, 0, 18, 36, 54, 72, 90, 108, 127, 100, 50, 43, 37, 31, 25, 18, 12, 6, 0,
0, 0, 31, 63, 95, 127, 159, 191, 223, 255, 255, 255, 127, 108, 90, 72, 54, 36,
18, 0, 0, 28, 56, 85, 113, 141, 170, 198, 226, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255), SDO_NUMBER_ARRAY(255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255))

SDO_GEOR.getColorMapTable

Format

SDO_GEOR.getColorMapTable(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Returns the colormap table for pseudocolor display of a layer in a GeoRaster object.

Note:

GeoRaster does not perform operations using the colormap table in the current release.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the colormap table. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns the name of a user-defined colormap table. For information about colormaps, see Section 2.3.2.

To set the colormap table for a layer in a GeoRaster object, use the SDO_GEOR.setColorMapTable procedure.

If georaster or its metadata is null, this function returns a null value.

An exception is raised if layerNumber is null, negative, or greater than the maximum layer number.

Examples

The following example returns the colormap table for layer 2 of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT sdo_geor.getColorMapTable(georaster, 2) FROM georaster_table WHERE georid=4;
 
SDO_GEOR.GETCOLORMAPTABLE(GEORASTER,2)
--------------------------------------------------------------------------------
CMT1
 
1 row selected.

SDO_GEOR.getCompressionType

Format

SDO_GEOR.getCompressionType(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the compression type for a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

This function can return DEFLATE, JPEG-B, JPEG-F, or NONE (the latter value meaning that the GeoRaster object is not compressed). For information about GeoRaster compression, see Section 1.10.

Examples

The following example returns the compression type for the GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT georid, substr(sdo_geor.getCompressionType(georaster),1,20) compressionType
  FROM georaster_table;

    GEORID COMPRESSIONTYPE
---------- --------------------
         2 DEFLATE
         4 JPEG-B

SDO_GEOR.getDefaultBlue

Format

SDO_GEOR.getDefaultBlue(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the number of the layer to be used for the blue color component (in the RGB color space) for displaying a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

The default red, green, and blue values are used for true-color displays, not for pseudocolor or grayscale displays. These values are optional, and they are intended for use only when visualizing multilayer or hyperspectral GeoRaster objects.

You can return the layer numbers for all three color components (RGB) by using the SDO_GEOR.getDefaultColorLayer function.

Examples

The following example returns the layer numbers for the red, blue, and green color components for displaying the GeoRaster objects in the table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT georid, sdo_geor.getDefaultRed(georaster) red,
  sdo_geor.getDefaultGreen(georaster) green,
  sdo_geor.getDefaultBlue(georaster) blue
FROM georaster_table;
 
    GEORID        RED      GREEN       BLUE
---------- ---------- ---------- ----------
         1          1          2          3
         2
         3         31         20         13

SDO_GEOR.getDefaultColorLayer

Format

SDO_GEOR.getDefaultColorLayer(

     georaster IN SDO_GEORASTER

     ) RETURN SDO_NUMBER_ARRAY;

Description

Returns the default numbers of the layers to be used for the red, green, and blue color components, respectively, for displaying a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

The RGB layer numbers returned are used for true-color displays, not for pseudocolor or grayscale displays.

You can return the layer number for each color component (RGB) by using the SDO_GEOR.getDefaultRed, SDO_GEOR.getDefaultGreen, and SDO_GEOR.getDefaultBlue functions.

Examples

The following example sets the default red, green, and blue color layers for the GeoRaster objects (GEORASTER column) in table GEORASTER_TABLE, and it returns an array with the layer numbers for the red, green, and blue color components for displaying these GeoRaster objects. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setDefaultRed(grobj, 2);
  sdo_geor.setDefaultGreen(grobj, 3);
  sdo_geor.setDefaultBlue(grobj, 1);
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SELECT sdo_geor.getDefaultColorLayer(georaster) FROM georaster_table WHERE georid=4;
 
SDO_GEOR.GETDEFAULTCOLORLAYER(GEORASTER)
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(2, 3, 1)
 
1 row selected.

SDO_GEOR.getDefaultGreen

Format

SDO_GEOR.getDefaultGreen(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the number of the layer to be used for the green color component (in the RGB color space) for displaying a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

The default red, green, and blue values are used for true-color displays, not for pseudocolor or grayscale displays. These values are optional, and they are intended for use only when visualizing multilayer or hyperspectral GeoRaster objects.

You can return the layer numbers for all three color components (RGB) by using the SDO_GEOR.getDefaultColorLayer function.

Examples

The following example returns the layer numbers for the red, blue, and green color components for displaying the GeoRaster objects in the table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT georid, sdo_geor.getDefaultRed(georaster) red,
  sdo_geor.getDefaultGreen(georaster) green,
  sdo_geor.getDefaultBlue(georaster) blue
FROM georaster_table;
 
    GEORID        RED      GREEN       BLUE
---------- ---------- ---------- ----------
         1          1          2          3
         2
         3         31         20         13

SDO_GEOR.getDefaultRed

Format

SDO_GEOR.getDefaultRed(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the number of the layer to be used for the red color component (in the RGB color space) for displaying a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

The default red, green, and blue values are used for true-color displays, not for pseudocolor or grayscale displays. These values are optional, and they are intended for use only when visualizing multilayer or hyperspectral GeoRaster objects.

You can return the layer numbers for all three color components (RGB) by using the SDO_GEOR.getDefaultColorLayer function.

Examples

The following example returns the layer numbers for the red, blue, and green color components for displaying the GeoRaster objects in the table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT georid, sdo_geor.getDefaultRed(georaster) red,
  sdo_geor.getDefaultGreen(georaster) green,
  sdo_geor.getDefaultBlue(georaster) blue
FROM georaster_table;
 
    GEORID        RED      GREEN       BLUE
---------- ---------- ---------- ----------
         1          1          2          3
         2
         3         31         20         13

SDO_GEOR.getEndDateTime

Format

SDO_GEOR.getEndDateTime(

     georaster IN SDO_GEORASTER

     ) RETURN TIMESTAMP WITH TIME ZONE;

Description

Returns the ending date and time for raster data collection in the metadata for a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

To set the ending date and time for raster data collection in the metadata for a GeoRaster object, use the SDO_GEOR.setEndDateTime procedure.

If georaster or its metadata is null, this function returns a null value.

Examples

The following example returns the beginning and ending dates and times for raster data collection in the metadata for the GeoRaster object in a table named GEORASTER_TABLE where the GEORID column contains the value 4. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

SELECT sdo_geor.getBeginDateTime(georaster) beginDateTime,
  sdo_geor.getEndDateTime(georaster) endDateTime
  FROM georaster_table WHERE georid=4;
 
BEGINDATETIME
---------------------------------------------------------------------------
ENDDATETIME
---------------------------------------------------------------------------
01-JAN-00 05.00.00.000000000 AM +00:00
15-NOV-02 08.00.00.000000000 PM +00:00

SDO_GEOR.getGeoreferenceType

Format

SDO_GEOR.getGeoreferenceType(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns a number that indicates the georeference type for a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

This function returns one of the following numbers to indicate the georeference type: 1 for unknown type or null GeoRaster object, 2 for affine transform, 3 for direct linear transform (DLT), or 4 for rational polynomial coefficient (RPC).

For an explanation of georeferencing, see Section 1.6.

Examples

The following example returns the georeference type for the GeoRaster objects in a table named GEORASTER_TABLE. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

SELECT georid,sdo_geor.getGeoreferenceType(a.georaster)
  FROM georaster_table a ORDER BY georid;
 
    GEORID SDO_GEOR.GETGEOREFERENCETYPE(A.GEORASTER)
---------- -----------------------------------------
         1                                         1
         2                                         1
         3                                         1
         4                                         1
         5                                         1
         7                                         1
         8                                         2
         9                                         1
        10                                         1
        12                                         1
        13                                         1
        14                                         2
        15                                         1
        16                                         1
        17                                         1
        18                                         1
        19                                         2
        20                                         2
        21                                         4
        22                                         4

SDO_GEOR.getGrayScale

Format

SDO_GEOR.getGrayScale(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN SDO_GEOR_GRAYSCALE;

Description

Returns the grayscale mappings for a layer in a GeoRaster object.

Parameters

georaster

GeoRaster object.

layerNumber

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

Usage Notes

This function returns an object of type SDO_GEOR_GRAYSCALE. Section 2.3.3 describes grayscale display and this object type.

To set the grayscale mappings for a layer in a GeoRaster object, use the SDO_GEOR.setGrayScale procedure.

Examples

The following example returns the grayscale mappings for layer 0 of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 0 in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT sdo_geor.getGrayScale(georaster, 0) FROM georaster_table WHERE georid=0;
 
SDO_GEOR.GETGRAYSCALE(GEORASTER,0)(CELLVALUE, GRAY)
--------------------------------------------------------------------------------
SDO_GEOR_GRAYSCALE(SDO_NUMBER_ARRAY(10, 20, 30, 255), SDO_NUMBER_ARRAY(180, 210,
230, 250))

SDO_GEOR.getGrayScaleTable

Format

SDO_GEOR.getGrayScaleTable(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Returns the grayscale mapping table for a layer in a GeoRaster object.

Note:

GeoRaster does not perform operations using the grayscale mapping table in the current release.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the grayscale mapping table. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns the name of a user-defined grayscale table. Section 2.3.3 describes grayscale display.

To set the grayscale mapping table for a layer in a GeoRaster object, use the SDO_GEOR.setGrayScaleTable procedure.

Examples

The following example returns the grayscale mapping tables for layers 0, 1, 2, and 3 of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1. The output is reformatted for readability.)

SELECT substr(sdo_geor.getGrayScaleTable(georaster, 0),1,20) grayScaleTable0,
       substr(sdo_geor.getGrayScaleTable(georaster, 1),1,20) grayScaleTable1,
       substr(sdo_geor.getGrayScaleTable(georaster, 2),1,20) grayScaleTable2,
       substr(sdo_geor.getGrayScaleTable(georaster, 3),1,20) grayScaleTable3
  FROM georaster_table WHERE georid=4;

GRAYSCALETABLE0      GRAYSCALETABLE1      GRAYSCALETABLE2      GRAYSCALETABLE3
-------------------- -------------------- -------------------- -----------------
SCL0                 SCL1                 SCL2                 SCL3

SDO_GEOR.getHistogram

Format

SDO_GEOR.getHistogram(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN SDO_GEOR_HISTOGRAM;

Description

Returns the histogram for a layer in a GeoRaster object.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the histogram. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns an object of type SDO_GEOR_HISTOGRAM. Section 2.3.1 describes this object type and briefly discusses histograms.

Examples

The following example returns the histogram for layer 1 of a 4-bit GeoRaster object in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT sdo_geor.getHistogram(georaster, 1) layer1
 FROM georaster_table WHERE georid=17;
 
LAYER1(CELLVALUE, COUNT)
--------------------------------------------------------------------------------
SDO_GEOR_HISTOGRAM(SDO_NUMBER_ARRAY(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,12, 13,
 14, 15), SDO_NUMBER_ARRAY(10, 18, 10, 110, 200, 120, 130, 150, 160, 103, 106,
 190, 12, 17, 10, 5))

SDO_GEOR.getHistogramTable

Format

SDO_GEOR.getHistogramTable(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Returns the histogram table for a layer in a GeoRaster object.

Note:

GeoRaster does not perform operations using the histogram table in the current release.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the name of the histogram table. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns a user-defined histogram table. Section 2.3.1 briefly discusses histograms.

To set the name of the histogram table for a layer, use the SDO_GEOR.setHistogramTable procedure.

Examples

The following example returns the histogram tables for layers 0 (the whole object), 1, 2, and 3 of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1. The output is reformatted for readability.)

SELECT substr(sdo_geor.getHistogramTable(georaster, 0),1,20) histogramTable0,
       substr(sdo_geor.getHistogramTable(georaster, 1),1,20) histogramTable1,
       substr(sdo_geor.getHistogramTable(georaster, 2),1,20) histogramTable2,
       substr(sdo_geor.getHistogramTable(georaster, 3),1,20) histogramTable3
  FROM georaster_table WHERE georid=4;

HISTOGRAMTABLE0      HISTOGRAMTABLE1      HISTOGRAMTABLE2      HISTOGRAMTABLE3
-------------------- -------------------- -------------------- -----------------
HIST0                HIST1                HIST2                HIST3

SDO_GEOR.getID

Format

SDO_GEOR.getID(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the user-defined identifier value associated with a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

To set a user-defined identifier value for a GeoRaster object, use the SDO_GEOR.setID procedure.

Examples

The following example returns the user-defined identifier values of the GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT georid, substr(sdo_geor.getID(georaster),1,50) GEOR_ID
  FROM georaster_table;

    GEORID GEOR_ID 
---------- --------------------------------------------------
         2 TM_102
         4 TM_104

SDO_GEOR.getInterleavingType

Format

SDO_GEOR.getInterleavingType(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the interleaving type for a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

This function returns one of the following values: BSQ (band sequential), BIL (band interleaved by line), or BIP (band interleaved by pixel).

To change the interleaving type for a GeoRaster object, use the SDO_GEOR.changeFormatCopy procedure, and use the interleaving keyword in the storageParam parameter string.

Examples

The following example returns the cell depth, interleaving type, and blocking type 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 Section 1.4.1.

SELECT sdo_geor.getCellDepth(georaster) CellDepth,
       substr(sdo_geor.getInterleavingType(georaster),1,8) interleavingType,
       substr(sdo_geor.getBlockingType(georaster),1,8) blocking
  FROM georaster_table WHERE georid=21;

 CELLDEPTH INTERLEA BLOCKING
---------- -------- --------
         8 BSQ      REGULAR

SDO_GEOR.getLayerDimension

Format

SDO_GEOR.getLayerDimension(

     georaster IN SDO_GEORASTER

     ) RETURN SDO_STRING_ARRAY;

Description

Returns the dimension that is mapped as the logical layer dimension of a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

The layer dimension refers to the physical entity associated with the logical term layer. For the current release, the only supported layer dimension is BAND: that is, the logical concept layer is associated with the physical term band, as shown in Figure 1-5 in Section 1.5. In this case, layers will be mapped to the BAND dimension, so that the first layer is band 0, the second layer is band 1, and so on.

Examples

The following example returns the layer dimension of each GeoRaster object (GEORASTER column) in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1. (The output is reformatted for readability.)

SELECT georid, sdo_geor.getLayerDimension(georaster) FROM georaster_table;

    GEORID SDO_GEOR.GETLAYERDIMENSION(GEORASTER)
---------- ------------------------------------------------------------------
         2 SDO_STRING_ARRAY('BAND')
         4 SDO_STRING_ARRAY('BAND')

SDO_GEOR.getLayerID

Format

SDO_GEOR.getLayerID(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Returns the user-defined identifier value associated with a layer in a GeoRaster object.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the user-defined identifier value. A value of 0 (zero) indicates the object layer.

Usage Notes

To set a user-defined identifier value for a layer in a GeoRaster object, use the SDO_GEOR.setLayerID procedure.

Examples

The following example returns the user-defined identifier values of layers 0, 1, 2, and 3 of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT substr(sdo_geor.getLayerID(georaster, 0),1,12) layerID0,
       substr(sdo_geor.getLayerID(georaster, 1),1,12) layerID1,
       substr(sdo_geor.getLayerID(georaster, 2),1,12) layerID2,
       substr(sdo_geor.getLayerID(georaster, 3),1,12) layerID3
  FROM georaster_table WHERE georid=4;

LAYERID0     LAYERID1     LAYERID2     LAYERID3
------------ ------------ ------------ ------------
TM543        TM3          TM4          TM5

SDO_GEOR.getLayerOrdinate

Format

SDO_GEOR.getLayerOrdinate(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN NUMBER;

Description

Returns the band ordinate for a layer in a GeoRaster object.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the physical band ordinate. A value of 0 (zero) indicates the object layer.

Usage Notes

The returned number refers to the physical band that a layer (layerNumber parameter value) is associated with. For the current release, by default the associations are as shown in Figure 1-5 in Section 1.5: layer 1 is band 0, layer 2 is band 1, and so on.

To set the band ordinate value for a layer, use the SDO_GEOR.setLayerOrdinate procedure.

Examples

The following example returns the band numbers associated with layers 0, 1, 2, and 3 of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT sdo_geor.getLayerOrdinate(georaster, 0) layerOrdinate0,
       sdo_geor.getLayerOrdinate(georaster, 1) layerOrdinate1,
       sdo_geor.getLayerOrdinate(georaster, 2) layerOrdinate2,
       sdo_geor.getLayerOrdinate(georaster, 3) layerOrdinate3
  FROM georaster_table WHERE georid=4;

LAYERORDINATE0 LAYERORDINATE1 LAYERORDINATE2 LAYERORDINATE3
-------------- -------------- -------------- --------------
                            0              1              2

SDO_GEOR.getModelCoordinate

Format

SDO_GEOR.getModelCoordinate(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     cellCoordinate IN SDO_NUMBER_ARRAY,

     height IN NUMBER DEFAULT NULL,

     ) RETURN SDO_GEOMETRY;

or

SDO_GEOR.getModelCoordinate(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     cellCoordinate IN SDO_GEOMETRY,

     modelCoordinate OUT SDO_GEOMETRY,

     height IN NUMBER DEFAULT NULL);

Description

Returns a geometry associated with the specified cell (raster) coordinates at the specified pyramid level.

Parameters

georaster

GeoRaster object.

pyramidLevel

Pyramid level containing the cell specified in cellCoordinate.

cellCoordinate

If the type is SDO_NUMBER_ARRAY, cellCoordinate is an array of two coordinates identifying the point in the cell coordinate system: the two coordinates are the row number and column number of the point. If the type is SDO_GEOMETRY, cellCoordinate specifies a geometry in the cell coordinate system

modelCoordinate

The output geometry.

height

Number specifying the Z value for three-dimensional (X, Y, Z) georeferencing.

Usage Notes

SDO_GEOR.getModelCoordinate has two formats:

  • Use the first format (a function without the modelCoordinate parameter) to transform the location of a point in the GeoRaster object's raster space.

  • Use the second format (a procedure with the modelCoordinate parameter) to transform a geometry in the raster space of the GeoRaster object. The conversion is done by converting the coordinates of each vertex of the input geometry. Use an appropriate input geometry so that the output geometry will be valid. For example, if the model coordinate system is geodetic, the input geometry should not contain any arcs.

Use SDO_GEOR.getModelCoordinate to transform the location of a point on the GeoRaster object to the longitude and latitude coordinates of its associated point in the ground coordinate system.

If the GeoRaster object is georeferenced, the output geometry contains the coordinates in the model (ground) coordinate system. If the GeoRaster object is not georeferenced, the output geometry contains cell coordinates at the original image level.

If the GeoRaster object is georeferenced, the SDO_SRID value of the output geometry is the same as the model SRID of the GeoRaster object.

Contrast SDO_GEOR.getModelCoordinate with SDO_GEOR.getCellCoordinate, which returns the coordinates in the cell (raster) coordinate system associated with the point at the specified model (ground) coordinates.

Examples

The following example returns a point geometry object containing the model coordinates associated with cell coordinates (100,100) in a specified GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

SET NUMWIDTH 20
SELECT sdo_geor.getModelCoordinate(georaster, 0,
sdo_number_array(100,100)) mcoord
  FROM georaster_table WHERE georid=4;
 
MCOORD(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
--------------------------------------------------------------------------------
 
SDO_GEOMETRY(2001, 82394, SDO_POINT_TYPE(347.666315789474, 43274.9052631579, NUL
L), NULL, NULL)

SDO_GEOR.getModelCoordLocation

Format

SDO_GEOR.getModelCoordLocation(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the model coordinate location value for a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

This function returns a null value if the GeoRaster object is not georeferenced or if the modelCoordinateLocation element is not specified in the SRS metadata. Otherwise, it returns the modelCoordinateLocation element value specified in the SRS metadata.

A null return value or a value of CENTER means that the cell coordinate system is center-based. A value of UPPERLEFT means that the cell coordinate system is based on the upper-left corner.

Examples

The following example returns the model coordinate location of a specified GeoRaster object.

SELECT sdo_geor.getModelCoordLocation(georaster) modelCoordLocation
  FROM georaster_table
  WHERE georid = 1;

SDO_GEOR.getModelSRID

Format

SDO_GEOR.getModelSRID(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the coordinate system (SDO_SRID value) associated with the model (ground) space for a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

This function returns a null value if no coordinate system is associated with the model space.

To set the coordinate system (SDO_SRID value) associated with the model space, use the SDO_GEOR.setModelSRID procedure.

Examples

The following example returns the SDO_SRID values associated with the GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT georid, sdo_geor.getModelSRID(georaster) SRID FROM georaster_table;

    GEORID       SRID
---------- ----------
         2       82394
         4       82394

SDO_GEOR.getNODATA

Format

SDO_GEOR.getNODATA(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

or

SDO_GEOR.getNODATA(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN SDO_RANGE_ARRAY;

Description

Returns the values or value ranges that represent NODATA cells in a GeoRaster object (in ascending order, without duplicates).

Parameters

georaster

GeoRaster object.

layerNumber

Layer number in the GeoRaster object. A value of 0 (zero) indicates the object layer.

Usage Notes

Note:

The first function format (returning a number) is deprecated, and will not be supported in future releases. You are encouraged to use the second format (returning an SDO_RANGE_ARRAY object).

Some cells of a GeoRaster object may have no meaningful value assigned or collected. Such cells contain a NODATA value are thus called NODATA cells, which means that those cells are not semantically defined. The application is responsible for defining the meaning or significance of cells identified as NODATA cells. For more information about NODATA values and value ranges, see Section 1.9.

This function returns all the NODATA values and value ranges associated with a specified raster layer of the specified GeoRaster object, in ascending order and in a compact form with duplicates eliminated. The set of NODATA values and value ranges associated with a sublayer (layerNumber > 0) is always a superset of the values and value ranges of the object layer (layerNumber = 0). The result for a sublayer is the combination of the NODATA metadata entries for the specified sublayer, the object layer, and any pre-release 11g NODATA metadata stored as part of the raster description information.

If the specified GeoRaster object or layer has more than one NODATA value, you must use the function format that returns an SDO_RANGE_ARRAY object. The SDO_RANGE_ARRAY type is described in Section 1.9.

If this function returns a null value, it means that all cells of the GeoRaster object or of the specified layer are defined and have a meaningful cell value.

To specify the NODATA values for a GeoRaster object, use the SDO_GEOR.addNODATA procedure.

Examples

The following example returns the value to be used for NODATA cells in the GeoRaster objects (GEORASTER column) in table GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT SDO_GEOR.getNODATA(georaster, 0) NODATA FROM georaster_table WHERE georid=0;

NODATA
------------
SDO_RANGE_ARRAY(SDO_RANGE(5,7))

SDO_GEOR.getPyramidMaxLevel

Format

SDO_GEOR.getPyramidMaxLevel(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the level number of the top pyramid of a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

For information about pyramids, see Section 1.7.

Examples

The following example returns the pyramid type and level number of the top pyramid for the GeoRaster object (GEORASTER column) in the row with an GEORID column value of 21 in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT substr(sdo_geor.getPyramidType(georaster),1,10) pyramidType,
       sdo_geor.getPyramidMaxLevel(georaster) maxLevel
  FROM georaster_table WHERE georid=21;

PYRAMIDTYP   MAXLEVEL
---------- ----------
DECREASE            3

SDO_GEOR.getPyramidType

Format

SDO_GEOR.getPyramidType(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the pyramid type for a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

The pyramid type can be NONE (no pyramids) or DECREASE.

For information about pyramids, see Section 1.7.

Examples

The following example returns the pyramid type and level number of the top pyramid for the GeoRaster object (GEORASTER column) in the row with an GEORID column value of 21 in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT substr(sdo_geor.getPyramidType(georaster),1,10) pyramidType,
       sdo_geor.getPyramidMaxLevel(georaster) maxLevel
  FROM georaster_table WHERE georid=21;

PYRAMIDTYP   MAXLEVEL
---------- ----------
DECREASE            3

SDO_GEOR.getRasterBlockLocator

Format

SDO_GEOR.getRasterBlockLocator(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     bandBlockNumber IN NUMBER,

     rowBlockNumber IN NUMBER,

     columnBlockNumber IN NUMBER,

     loc IN OUT NOCOPY BLOB,

     isBitmapMask IN VARCHAR2 DEFAULT NULL,

     lock_for_write IN VARCHAR2 DEFAULT NULL);

Description

Gets the LOB locator of a specified raster block.

Parameters

georaster

GeoRaster object.

pyramidLevel

Pyramid level of the block.

bandBlockNumber

Band number of the block.

rowBlockNumber

Row number of the block.

columnBlockNumber

Column number of the block.

loc

LOB locator.

isBitmapMask

The string TRUE specifies that a bitmap mask block will be accessed; the string FALSE specifies that a regular raster block will be accessed. If you do not specify this parameter, a regular raster block will be accessed. For an explanation of bitmap masks, see Section 1.8.

lockForWrite

The string TRUE locks the row in the raster data table so that other users cannot lock or update that row until the current transaction ends; the string FALSE does not lock the row in the raster data table. If you do not specify this parameter, the row is not locked.

Usage Notes

This procedure gets the raster block locator using the specified parameters. The LOB locator is not opened, and no data is read or processed. You should use standard LOB operations to open and close the LOB locator and to read data from and write data to the LOB locator.

To ensure that data is read or written correctly, you must understand the physical storage of the raster data (described in Section 1.4), and you must compress and decompress the raster data as needed.

For information about LOB locators, see Oracle Database SecureFiles and Large Objects Developer's Guide.

Examples

The following example gets the LOB locators of two raster blocks, the first a regular raster block and the second a bitmap mask block. Both calls to the SDO_GEOR.getRasterBlockLocator procedure lock the row in the raster data table.

declare
gr sdo_georaster;
lb blob;
r1 raw(1024);
 
ln number;
begin
r1 := utl_raw.copies(utl_raw.cast_to_raw('0'),1024);
 
 
select georaster into gr from georaster_table where georid=1;
sdo_geor.getRasterBlockLocator(gr, 0, 0, 0, 0, lb, null, 'TRUE');
ln := 1024;
dbms_lob.write(lb, ln, 1, r1);
 
sdo_geor.getRasterBlockLocator(gr, 0, 0, 0, 0, lb, 'TRUE', 'TRUE');
ln := 128;
dbms_lob.write(lb, ln, 1, r1);
end;
/

SDO_GEOR.getRasterBlocks

Format

SDO_GEOR.getRasterBlocks(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     window IN SDO_NUMBER_ARRAY

     ) RETURN SDO_RASTERSET;

or

SDO_GEOR.getRasterBlocks(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     window IN SDO_GEOMETRY

     ) RETURN SDO_RASTERSET;

Description

Returns an object of the SDO_RASTERSET collection type that identifies all blocks of a specified pyramid level that have any spatial interaction with a specified window.

Parameters

georaster

GeoRaster object.

pyramidLevel

Pyramid level from which to return the blocks that have any spatial interaction with the specified window.

window

Window from which to return the blocks that are in pyramidLevel. The data type can be SDO_NUMBER_ARRAY or SDO_GEOMETRY. 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, see the Usage Notes for SDO_SRID requirements.

Usage Notes

The SDO_RASTERSET collection type is described in Section 2.3.4.

If the window 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 window parameter geometry and the model space are different, the window 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 Section 1.3.)

Examples

The following example returns a collection set that identifies all raster blocks that have any spatial interaction with the specified window. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  gr sdo_georaster;
  ds sdo_rasterset;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=2;
  ds := sdo_geor.getRasterBlocks(gr, 0, sdo_number_array(11,65,192,244));
  COMMIT;
END;
/

SDO_GEOR.getRasterData

Format

SDO_GEOR.getRasterData(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     rasterBlob IN OUT NOCOPY BLOB,

     storageParam IN VARCHAR2 DEFAULT NULL,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Creates a single BLOB object that contains all raster data of the input GeoRaster object at the specified pyramid level.

Parameters

georaster

GeoRaster object.

pyramidLevel

Pyramid level for which to perform the operation.

rasterBlob

BLOB object to hold the result.

storageParam

A string specifying storage parameters to be applied in creating rasterBlob. The only storageParam keywords supported for this procedure are celldepth, compression, interleaving, and quality; all other keywords are ignored. Storage parameters are explained in Section 1.4.1.

If storageParam is null or not specified, the cell depth, interleaving, and compression type (and compression quality, if applicable) are the same as for the input GeoRaster object.

bgValues

Background values for filling sparse data. The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filing value used for all bands) or the band dimension size (a different filling value for each band, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) fills the first band with 1, the second band with 5, and the third band with 10.

This parameter is useful when the source has empty raster blocks (see Section 1.4.4). If this parameter is not specified, any cells that are derived from an empty raster block are filled with the value 0 in the output BLOB.

Usage Notes

If the GeoRaster object is blocked, the mosaic of all blocks of the specified pyramid level is returned.

After the procedure completes, the rasterBlob object contains the cell (pixel) data without tiling.

You can specify compression even if the input GeoRaster object is not compressed or is compressed in a different format from what you specify in the storageParam parameter. To have decompressed output for a compressed input GeoRaster object, specify compression=NONE in the storageParam parameter. For information about GeoRaster compression and decompression, see Section 1.10.

Examples

The following example creates a BLOB object, using full-format baseline JPEG (JPEG-F) compression, with all raster data from the GeoRaster object whose ID value is 2 in the GEORASTER_TABLE table. The definition of this table is presented after Example 1-1 in Section 1.4.1.

DECLARE
  gr sdo_georaster;
  lb blob;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=2;
  dbms_lob.createTemporary(lb, FALSE);
  sdo_geor.getRasterData(gr, 0, lb, 'compress=JPEG-F');
  dbms_lob.freeTemporary(lb);
END;
/

SDO_GEOR.getRasterSubset

Format

SDO_GEOR.getRasterSubset(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     window IN SDO_NUMBER_ARRAY,

     bandNumbers IN VARCHAR2,

     rasterBlob IN OUT NOCOPY BLOB,

     storageParam IN VARCHAR2 DEFAULT NULL,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.getRasterSubset(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     inWindow IN SDO_NUMBER_ARRAY,

     bandNumbers IN VARCHAR2,

     rasterBlob IN OUT NOCOPY BLOB,

     outWindow OUT SDO_NUMBER_ARRAY,

     storageParam IN VARCHAR2 DEFAULT NULL,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.getRasterSubset(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     window IN SDO_GEOMETRY,

     layerNumbers IN VARCHAR2,

     rasterBlob IN OUT NOCOPY BLOB,

     storageParam IN VARCHAR2 DEFAULT NULL,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.getRasterSubset(

     georaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     inWindow IN SDO_GEOMETRY,

     layerNumbers IN VARCHAR2,

     rasterBlob IN OUT NOCOPY BLOB,

     outWindow OUT SDO_NUMBER_ARRAY,

     storageParam IN VARCHAR2 DEFAULT NULL,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Creates a single BLOB object containing all cells of a specified pyramid level that are inside or on the boundary of a specified window.

Parameters

georaster

GeoRaster object.

pyramidLevel

Pyramid level on which to perform the operation.

window, inWindow

A rectangular window from which to crop the cells. 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 MBR of the geometry object is used as the window; see also the Usage Notes for SDO_SRID requirements.

If window or inWindow is of type SDO_NUMBER_ARRAY, use the bandNumbers parameter to specify one or more band numbers; if window or inWindow is of type SDO_GEOMETRY, use the layerNumbers parameter to specify one or more layer numbers.

layerNumbers

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). If you specify a null value for this parameter, the operation or operations are performed on all layers.

bandNumbers

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). If you specify a null value for this parameter, the operation or operations are performed on all bands.

rasterBlob

BLOB object to hold the result (the mosaicked raster subset) of the operation. It must exist or have been initialized before the operation.

outWindow

An SDO_NUMBER_ARRAY object identifying the coordinates of the upper-left and lower-right corners of the output window in the cell space.

storageParam

A string specifying storage parameters to be applied in creating rasterBlob. The only supported storageParam keywords supported for this procedure are celldepth, compression, interleaving, and quality; all other keywords are ignored. Storage parameters are explained in Section 1.4.1.

If storageParam is null or not specified, the cell depth, interleaving, and compression type (and compression quality, if applicable) are the same as for the input GeoRaster object.

bgValues

Background values for filling sparse data. The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filing value used for all bands) or the band dimension size (a different filling value for each band, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) fills the first band with 1, the second band with 5, and the third band with 10.

This parameter is useful when the source has empty raster blocks and the output window intersects any empty raster blocks (see Section 1.4.4). If this parameter is not specified, any cells in the output window that are derived from an empty raster block are filled with the value 0 in the output BLOB.

Usage Notes

This procedure has four formats, depending on whether the input window is specified as a geometry object or as the upper-left and lower-right corners of a box, and on whether the outWindow parameter is used to return the coordinates of the output window.

If the window or inWindow 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 window parameter geometry and the model space are different, the window 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 Section 1.3.)

If the window or inWindow parameter specifies a geodetic MBR, it cannot cross the date line meridian. For information about geodetic MBRs, see Oracle Spatial Developer's Guide.

After the procedure completes, the rasterBLOB parameter contains the cell (pixel) data in the cropped window without tiling. The cropped window is the overlapping portion of the specified window of interest and the source GeoRaster object's spatial extent. If the outWindow parameter is specified, after the procedure completes it contains the coordinates of the cropped window in the cell space.

The BLOB has no padding, except when the cell depth is less than 8 bits and the total number of bits needed for the output cannot be divided by 8; in these cases, unlike normal padding, only the last byte of the result is padded with 0 (zeros) for the trailing bits.

You can specify compression even if the input GeoRaster object is not compressed or is compressed in a different format from what you specify in the storageParam parameter. To have decompressed output for a compressed input GeoRaster object, specify compression=NONE in the storageParam parameter. For information about GeoRaster compression and decompression, see Section 1.10.

Examples

The following example retrieves raster data of a specified pyramid level inside a specified window. (It refers to the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  gr sdo_georaster;
  lb blob;
  win sdo_number_array;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=4;
  dbms_lob.createTemporary(lb, TRUE);
  win := sdo_number_array(-21,100,100,200);
  sdo_geor.getRasterSubset(gr, 0, win, null, lb);
  dbms_lob.freeTemporary(lb);
END;
/

The following example demonstrates how to get the window for the cropping. (It refers to the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  gr sdo_georaster;
  lb blob;
  win1 sdo_geometry;
  win2 sdo_number_array;
BEGIN
  SELECT georaster INTO gr FROM georaster_table WHERE georid=4;
  dbms_lob.createTemporary(lb, TRUE);
  win1 := sdo_geometry(2003,82263,null,sdo_elem_info_array(1,1003,3),
                       sdo_ordinate_array(1828466,646447,1823400,642512));
  sdo_geor.getRasterSubset(gr, 0, win1, '1-3', lb, win2, 'compression=NONE');
  dbms_lob.freeTemporary(lb);
  IF win2 IS NOT NULL THEN
    dbms_output.put_line('output window: (' || win2(1) || ',' ||
                          win2(2) || ',' || win2(3) || ',' || win2(4) || ')');
  END IF;
END;
/

SDO_GEOR.getScaling

Format

SDO_GEOR.getScaling(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN SDO_NUMBER_ARRAY;

Description

Returns the coefficients of the scaling function for a layer of a GeoRaster object.

Note:

GeoRaster does not perform operations using the scaling function in the current release.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the coefficients. A value of 0 (zero) indicates the object layer.

Usage Notes

The scaling function is as follows:

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

The order of the coefficients is: a0, a1, b0, b1.

Examples

The following example returns the scaling coefficients for layer number 0 (the whole object) of a specified GeoRaster object in a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1. It scales original value range 0.0 to 1000.0 to be in the range 0.0 to 250.0.

SELECT sdo_geor.getScaling(georaster, 0) FROM georaster_table WHERE georid=0;
 
SDO_GEOR.GETSCALING(GEORASTER,0)
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(0.0, 0.25, 1, 0.0)

SDO_GEOR.getSourceInfo

Format

SDO_GEOR.getSourceInfo(

     georaster IN OUT SDO_GEORASTER,

     ) RETURN SDO_STRING2_ARRAY;

Description

Gets the source information for a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

This function returns the source information stored in the <sourceInfo> element in the metadata for the GeoRaster object (described in Appendix A).

The SDO_STRING2_ARRAY type is defined as VARRAY(2147483647) OF VARCHAR2(4096).

To replace or delete source information, use the SDO_GEOR.setSourceInfo procedure. To add source information, use the SDO_GEOR.addSourceInfo procedure.

Examples

The following example sets and adds some source information for a specified GeoRaster object, and then retrieves the information.

declare
 gr sdo_georaster;
begin
 select georaster into gr from georaster_table where georid=1 for update;
 sdo_geor.setSourceInfo(gr, 'Copyright (c) 2002, 2007, Oracle Corporation.');
 sdo_geor.addSourceInfo(gr, 'All rights reserved.');
 update georaster_table set georaster=gr where georid=1;
end;
/
 
select * from table(select sdo_geor.getSourceInfo(georaster) from georaster_table where id=1);
 
COLUMN_VALUE
--------------------------------------------------------------------------------
Copyright (c) 2002, 2007, Oracle Corporation.
All rights reserved.

SDO_GEOR.getSpatialDimNumber

Format

SDO_GEOR.getSpatialDimNumber(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the number of spatial dimensions of a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

For the current release, this function always returns 2.

To return the number of cells in each spatial dimension of a GeoRaster object, use the SDO_GEOR.getSpatialDimSizes function.

Examples

The following example returns the GEORID column value, the number of spatial dimensions, and the number of cells in each spatial dimension for the GeoRaster objects in the table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1. (The output is reformatted for readability.)

SELECT georid, sdo_geor.getSpatialDimNumber(georaster) spatialDim,
           sdo_geor.getSpatialDimSizes(georaster) spatialDimSizes
   FROM georaster_table;
 
    GEORID SPATIALDIM SPATIALDIMSIZES
---------- ---------- --------------------------------------------------------
         0          2 SDO_NUMBER_ARRAY(1024, 1024)
 
         1          2 SDO_NUMBER_ARRAY(384, 251)
 
         2          2 SDO_NUMBER_ARRAY(512, 512)
 
         4          2 SDO_NUMBER_ARRAY(512, 512)
 
        11          2 SDO_NUMBER_ARRAY(7957, 5828)

SDO_GEOR.getSpatialDimSizes

Format

SDO_GEOR.getSpatialDimSizes(

     georaster IN SDO_GEORASTER

     ) RETURN SDO_NUMBER_ARRAY;

Description

Returns the number of cells in each spatial dimension of a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

To return the number of spatial dimensions for a GeoRaster object, use the SDO_GEOR.getSpatialDimNumber function.

Examples

The following example returns the spatial dimension sizes and the number of bands for a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1. The output is reformatted for readability.)

SELECT sdo_geor.getSpatialDimSizes(georaster) spatialDimSizes,
       sdo_geor.getBandDimSize(georaster) bandDimSize
  FROM georaster_table WHERE georid=21;

SPATIALDIMSIZES                  BANDDIMSIZE
--------------------------       -----------
SDO_NUMBER_ARRAY(512, 512)           1

SDO_GEOR.getSpatialResolutions

Format

SDO_GEOR.getSpatialResolutions(

     georaster IN SDO_GEORASTER

     ) RETURN SDO_NUMBER_ARRAY;

Description

Returns the spatial resolution value along each spatial dimension of a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

Each value indicates the number of units of measurement associated with the data area represented by that spatial dimension of a pixel. For example, if the spatial resolution values are (10,10) and the unit of measurement for the ground data is meters, each pixel represents an area of 10 meters by 10 meters.

The spatial resolutions may be inconsistent with the georeferencing information, especially when the GeoRaster object is not georectified. You can use the SDO_GEOR.setSpatialResolutions procedure to set the spatial resolutions to be the average resolutions for an image or the resolutions when the data was collected. In this case, georeferencing information should be used for precise measurement.

Examples

The following example returns the spatial resolution values along the column and row (X and Y) dimensions of a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

SELECT sdo_geor.getSpatialResolutions(georaster) spatialResolution
  FROM georaster_table WHERE georid=42;

SPATIALRESOLUTION
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(28.5, 28.5)

SDO_GEOR.getSpectralResolution

Format

SDO_GEOR.getSpectralResolution(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the spectral resolution of a GeoRaster object if it is a hyperspectral or multiband image.

Parameters

georaster

GeoRaster object.

Usage Notes

Taken together, the spectral unit and spectral resolution identify the wavelength interval for a band. For example, if the spectral resolution value is 2 and the spectral unit value is MILLIMETER, the wavelength interval for a band is 2 millimeters.

To set the spectral resolution for a GeoRaster object, use the SDO_GEOR.setSpectralResolution procedure.

Examples

The following example returns the spectral unit and spectral resolution for all spatially referenced GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT georid, substr(sdo_geor.getSpectralUnit(georaster),1,20) spectralUnit,
               sdo_geor.getSpectralResolution(georaster) spectralResolution
  FROM georaster_table
 WHERE sdo_geor.isSpatialReferenced(georaster)='TRUE';

    GEORID SPECTRALUNIT         SPECTRALRESOLUTION
---------- -------------------- ------------------
         4 MILLIMETER                        0.075

SDO_GEOR.getSpectralUnit

Format

SDO_GEOR.getSpectralUnit(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the unit of measurement for identifying the wavelength interval for a band.

Parameters

georaster

GeoRaster object.

Usage Notes

This function can return one of the following values: METER, MILLIMETER, MICROMETER, NANOMETER.

Taken together, the spectral unit and spectral resolution identify the wavelength interval for a band. For example, if the spectral resolution value is 2 and the spectral unit value is MILLIMETER, the wavelength interval for a band is 2 millimeters.

To set the spectral unit for a GeoRaster object, use the SDO_GEOR.setSpectralUnit procedure.

Examples

The following example returns the spectral unit and spectral resolution for all spatially referenced GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT georid, substr(sdo_geor.getSpectralUnit(georaster),1,20) spectralUnit,
               sdo_geor.getSpectralResolution(georaster) spectralResolution
  FROM georaster_table
 WHERE sdo_geor.isSpatialReferenced(georaster)='TRUE';

    GEORID SPECTRALUNIT         SPECTRALRESOLUTION
---------- -------------------- ------------------
         4 MILLIMETER                        0.075

SDO_GEOR.getSRS

Format

SDO_GEOR.getSRS(

     georaster IN SDO_GEORASTER

     ) RETURN SDO_GEOR_SRS;

Description

Returns an object of type SDO_GEOR_SRS containing information related to the spatial referencing of a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

The SDO_GEOR_SRS object type is described in Section 2.3.5.

Examples

The following example returns information related to the spatial referencing of all spatially referenced GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT georid, sdo_geor.getSRS(georaster) SRS 
  FROM georaster_table
  WHERE sdo_geor.isSpatialReferenced(georaster)='TRUE';
 
    GEORID
----------
SRS(ISREFERENCED, ISRECTIFIED, ISORTHORECTIFIED, SRID, SPATIALRESOLUTION, SPATIA
--------------------------------------------------------------------------------
         4
SDO_GEOR_SRS('TRUE', 'TRUE', NULL, 82262, SDO_NUMBER_ARRAY(28.5, 28.5), NULL, NU
LL, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, NULL, NULL, NULL, SDO_NUMBER_ARRAY(1, 2, 1, 3,
 32631.5614, 0, -.03508772), SDO_NUMBER_ARRAY(1, 0, 0, 1, 1), SDO_NUMBER_ARRAY(1
, 2, 1, 3, -7894.7544, .035087719, 0), SDO_NUMBER_ARRAY(1, 0, 0, 1, 1))

SDO_GEOR.getStatistics

Format

SDO_GEOR.getStatistics(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN SDO_NUMBER_ARRAY;

Description

Returns statistical data associated with a layer.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the statistics. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns statistical data described by the <statisticDatasetType> element in the GeoRaster metadata XML schema, which is described in Appendix A. The function returns an array with the following values: MIN, MAX, MEAN, MEDIAN, MODEVALUE, and STD.

To set the statistical data associated with a layer, use the SDO_GEOR.setStatistics procedure.

Examples

The following example returns statistical data for layer 1 of a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

SELECT sdo_geor.getStatistics(georaster, 1) layer1
FROM georaster_table WHERE georid=4;
 
LAYER1
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(0, 255, 100, 127, 95, 25)

SDO_GEOR.getTotalLayerNumber

Format

SDO_GEOR.getTotalLayerNumber(

     georaster IN SDO_GEORASTER

     ) RETURN NUMBER;

Description

Returns the total number of layers in a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

For information about layers, see Section 1.5.

Examples

The following example returns the total number of layers in each GeoRaster object (GEORASTER column) in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

SELECT georid, sdo_geor.getTotalLayerNumber(georaster) totalLayerNumber
  FROM georaster_table;

    GEORID TOTALLAYERNUMBER
---------- ----------------
         2                1
         4                3

SDO_GEOR.getULTCoordinate

Format

SDO_GEOR.getULTCoordinate(

     georaster IN SDO_GEORASTER

     ) RETURN SDO_NUMBER_ARRAY ;

Description

Returns the cell coordinates of the upper-left corner of a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

This function returns two or three numbers. If it returns two numbers, they are row and column ordinates. If it returns three numbers, they are row, column, and band ordinates.

Examples

The following example returns the row, column, and band ordinates for the upper-left corner of a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

SELECT sdo_geor.getULTCoordinate(georaster) FROM georaster_table WHERE georid=23;

SDO_GEOR.GETULTCOORDINATE(GEORASTER)
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(256, 0, 0)

SDO_GEOR.getVAT

Format

SDO_GEOR.getVAT(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Returns the name of the value attribute table (VAT) associated with a layer of a GeoRaster object.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the VAT. A value of 0 (zero) indicates the object layer.

Usage Notes

For more information about value attribute tables, see Section 1.2.3.

To set the name of the value attribute table to be associated with a layer of a GeoRaster object, use the SDO_GEOR.setVAT procedure.

Examples

The following example returns the value attribute tables for layers 0, 1, 2, and 3 of the GeoRaster objects (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1. The output is reformatted for readability.)

SELECT substr(sdo_geor.getVAT(georaster, 0),1,20) vatTable0,
       substr(sdo_geor.getVAT(georaster, 1),1,20) vatTable1,
       substr(sdo_geor.getVAT(georaster, 2),1,20) vatTable2,
       substr(sdo_geor.getVAT(georaster, 3),1,20) vatTable3
  FROM georaster_table WHERE georid=4;

VATTABLE0            VATTABLE1            VATTABLE2            VATTABLE3
-------------------- -------------------- -------------------- ----------------
VAT0                 VAT1                 VAT2                 VAT1

SDO_GEOR.getVersion

Format

SDO_GEOR.getVersion(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the user-specified version of a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

The version returned is in the format major-version.minor-version.

To set the user-specified version of a GeoRaster object, use the SDO_GEOR.setVersion procedure.

Examples

The following example returns the user-specified version of the GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1. (The output is reformatted for readability.)

SELECT georid, sdo_geor.getVersion(georaster) version FROM georaster_table;

    GEORID VERSION
---------- --------------------------------------------------------------------
         2  10.1
         4  9i.2

SDO_GEOR.hasBitmapMask

Format

SDO_GEOR.hasBitmapMask(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Checks if a GeoRaster object or layer has an associated bitmap mask.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer to check. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns the string TRUE if the GeoRaster object or layer has an associated bitmap mask, or FALSE if it does not have an associated bitmap mask.

For an explanation of bitmap masks, see Section 1.8.

Examples

The following example checks if layers 0 through 4 of a specified GeoRaster object have associated bitmap masks.

SELECT substr(sdo_geor.hasBitmapMask(georaster,0),1,12) BM0,
       substr(sdo_geor.hasBitmapMask(georaster,1),1,12) BM1,
       substr(sdo_geor.hasBitmapMask(georaster,2),1,12) BM2,
       substr(sdo_geor.hasBitmapMask(georaster,3),1,12) BM3
  FROM georaster_table WHERE georid=0;

SDO_GEOR.hasGrayScale

Format

SDO_GEOR.hasGrayScale(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Checks if a layer of a GeoRaster object has grayscale information.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer to check. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns the string TRUE if the layer has grayscale information, or FALSE if the layer does not use grayscale representation. Section 2.3.3 describes grayscale display.

If the layer has grayscale information, you can get and set the grayscale mappings and the grayscale mapping table name. See the following: SDO_GEOR.getGrayScale and SDO_GEOR.getGrayScaleTable functions, and SDO_GEOR.setGrayScale and SDO_GEOR.setGrayScaleTable procedures.

Examples

The following example checks if layers 0 and 1 of a specified GeoRaster object (GEORASTER column) have grayscale information. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

SELECT substr(sdo_geor.hasGrayScale(georaster, 0),1,15) hasGrayScale0,
       substr(sdo_geor.hasGrayScale(georaster, 1),1,15) hasGrayScale1
  FROM georaster_table WHERE georid=4;

HASGRAYSCALE0   HASGRAYSCALE1
--------------- ---------------
TRUE            FALSE

SDO_GEOR.hasNODATAMask

Format

SDO_GEOR.hasNODATAMask(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Checks if a GeoRaster object or layer has an associated NODATA bitmap mask.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer to check. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns the string TRUE if the GeoRaster object or layer has an associated NODATA bitmap mask, or FALSE if it does not have an associated NODATA bitmap mask.

For an explanation of bitmap masks, see Section 1.8.

Examples

The following example checks if layers 0 through 4 of a specified GeoRaster object have associated NODATA bitmap masks.

SELECT substr(sdo_geor.hasNODATAMask(georaster,0),1,12) BM0,
       substr(sdo_geor.hasNODATAMask(georaster,1),1,12) BM1,
       substr(sdo_geor.hasNODATAMask(georaster,2),1,12) BM2,
       substr(sdo_geor.hasNODATAMask(georaster,3),1,12) BM3
  FROM georaster_table WHERE georid=0;

SDO_GEOR.hasPseudoColor

Format

SDO_GEOR.hasPseudoColor(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     ) RETURN VARCHAR2;

Description

Checks if a layer of a GeoRaster object has pseudocolor information.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer to check. A value of 0 (zero) indicates the object layer.

Usage Notes

This function returns the string TRUE if the layer has pseudocolor information, or FALSE if the layer does not have pseudocolor information (that is, does not use pseudocolor representation). Section 2.3.2 describes colormaps and pseudocolor display.

If the layer has pseudocolor information, you can get and set the colormap and colormap table name. See the following: SDO_GEOR.getColorMap and SDO_GEOR.getColorMapTable functions, and SDO_GEOR.setColorMap and SDO_GEOR.setColorMapTable procedures.

Examples

The following example checks if layers 0 and 1 of a specified GeoRaster object (GEORASTER column) have pseudocolor information. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

SELECT substr(sdo_geor.hasPseudoColor(georaster, 0),1,15) hasPseudoColor0,
       substr(sdo_geor.hasPseudoColor(georaster, 1),1,15) hasPseudoColor1
  FROM georaster_table WHERE georid=4;

HASPSEUDOCOLOR0 HASPSEUDOCOLOR1
--------------- ---------------
FALSE           TRUE

SDO_GEOR.importFrom

Format

SDO_GEOR.importFrom(

     georaster IN OUT SDO_GEORASTER,

     storageParam IN VARCHAR2,

     r_sourceFormat IN VARCHAR2,

     r_sourceType IN VARCHAR2,

     r_sourceName IN VARCHAR2,

     h_sourceFormat IN VARCHAR2 DEFAULT NULL,

     h_sourceType IN VARCHAR2 DEFAULT NULL,

     h_sourceName IN VARCHAR2 DEFAULT NULL);

or

SDO_GEOR.importFrom(

     georaster IN OUT SDO_GEORASTER,

     storageParam IN VARCHAR2,

     r_sourceFormat IN VARCHAR2,

     r_sourceBLOB IN BLOB,

     h_sourceFormat IN VARCHAR2 DEFAULT NULL,

     h_sourceCLOB IN CLOB DEFAULT NULL);

Description

Imports an image file or BLOB object into a GeoRaster object stored in the database.

Parameters

georaster

GeoRaster object to hold the result of the operation.

storageParam

String containing storage parameters. The format and usage are as explained in Section 1.4.1. Currently, the keywords supported for this operation are:

  • blocking: FALSE causes the image to be stored as a single block. If the blocksize parameter is not specified, TRUE causes the image to be reblocked using the default reblocking parameter values: (256,256,B), where B is the total number of bands that the image contains. If the blocksize parameter is specified, blocking is automatically interpreted as TRUE.

  • blocksize: (See the explanation in Table 1-1 in Section 1.4.1.)

  • compression: (See the explanation in Table 1-1 in Section 1.4.1.) The default value is NONE, which causes the raw data to be loaded without any compression.

  • quality: (See the explanation in Table 1-1 in Section 1.4.1.)

  • raster: TRUE (the default) causes the raster image data in a GeoTIFF format file to be loaded along with the georeferencing information; FALSE causes only the georeferencing information to be loaded from the GeoTIFF format file, without the raster image data, into an existing GeoRaster object.

  • spatialExtent: FALSE (the default) causes a spatial extent not to be generated; TRUE causes a spatial extent to be generated if the SRID is nonzero and matches the SRID of any existing spatial extent index.

  • srid: Coordinate system SRID numeric value, identifying an optional backup SRID, relevant when loading a GeoTIFF format file. This SRID value is used if the GeoTIFF configuration values do not match any SRID values recognized by Oracle Spatial.

r_sourceFormat

Raster source format. Must be one of the following: TIFF, GIF, BMP, GeoTIFF, or PNG. (JPEG is not supported for this procedure; however, you can use the client-side GeoRaster loader tool, described in Section 1.13, to import a JPEG file.)

r_sourceType

Type of source for the import operation. Must be FILE.

r_sourceName

Source file name (with full path specification) if r_sourceType is FILE. If you are using this procedure only to load the world file into an existing GeoRaster object, specify a null value for this parameter.

r_sourceBLOB

Raster source object of type BLOB.

h_sourceFormat

Geoheader source format. Must be WORLDFILE.

h_sourceType

Geoheader type of source for the import operation. Must be FILE.

h_sourceName

Geoheader source file name (with full path specification) if h_sourceType is FILE., and optionally an SRID value. To specify the SRID value, add it after the file name, separated by a comma. Example: '/mypath/mydir/worldfile.tfw,82934' (UNIX or Linux) or 'C:\mypath\mydir\worldfile.tfw,82934' (Windows)

h_sourceCLOB

Geoheader source as an object of type CLOB.

Usage Notes

For information about using this procedure or the GeoRaster loader tool to load raster data, see Section 3.3.

If you receive an "insufficient memory" error when loading a very large image, see Section 3.3.1.

Specify values for the parameters with names that start with r_ and h_ only if the raster image and the geoheader are in separate files or objects.

This procedure can load an ESRI world file from a file or from a CLOB object.

This procedure does not support JPEG as a source file format. You can use the client-side GeoRaster loader tool, described in Section 1.13, to import a JPEG file.

The GeoTIFF PixelIsArea raster space is equivalent to the GeoRaster upperleft-based cell coordinate system. An import from GeoTIFF is always to the GeoRaster center-based cell coordinate system, with a half-pixel adjustment of the affine transformation if the GeoTIFF file is specified in PixelIsArea raster space.

To load GeoTIFF images with the SDO_GEOR.importFrom procedure, you will need the xtiff-jai.jar and geotiff-jai.jar libraries. For more information about these GeoTIFF libraries, see Section 3.5.

This procedure does not support raster data that has a cell depth value of 2BIT or source multiband raster data with BIL and BSQ interleaving types.

The imported GeoRaster object has the BIP interleaving type.

Before you call this procedure, you must have read permission on the files to be imported or the directory that contains the files. The following example (run as user SYSTEM) grants read permission on a file to user HERMAN:

call dbms_java.grant_permission('HERMAN','SYS:java.io.FilePermission',
  '/mydirectory/myimages/img1.tif', 'read' );

Examples

The following example initializes an empty GeoRaster object into which an external image in TIFF format is to be imported, and then imports the image.

DECLARE   
   geor SDO_GEORASTER;
BEGIN  
-- Initialize an empty GeoRaster object into which the external image
-- is to be imported. 
INSERT INTO georaster_table
   values( 1, 'TIFF', sdo_geor.init('rdt_1') );  

-- Import the TIFF image. 
SELECT georaster INTO geor FROM georaster_table 
   WHERE georid = 1 FOR UPDATE; 
sdo_geor.importFrom(geor, NULL, 'TIFF', 'file', 
   '/mydirectory/myimages/img1.tif');  
UPDATE georaster_table SET georaster = geor WHERE georid = 1;  
COMMIT;
END;/

The following example imports images from a BLOB and an ESRI world file from a CLOB.

CREATE TABLE blob_table (blob_col BLOB, blobid NUMBER unique, clob_col CLOB);
INSERT INTO blob_table VALUES (empty_blob(), 1, null);
INSERT INTO blob_table VALUES (empty_blob(), 2, empty_clob());
COMMIT;
 
DECLARE
  geor1 SDO_GEORASTER;
  lobd1 BLOB;
  lobd2 CLOB;
  fileName VARCHAR2(1024);
  file BFILE;
  wfile BFILE;
  wfname VARCHAR2(1024);
  amt INTEGER;
  amt1 INTEGER;
 
BEGIN
-- Import BLOB into georaster object.
-- First, if appropriate, load an existing image file into a BLOB object. 
EXECUTE IMMEDIATE 'CREATE DIRECTORY  blob_test_one AS '''/xyz'''';
fileName := '/parrot.tif';
file := BFILENAME('BLOB_TEST_ONE', fileName);
wfname := '/parrot.tfw';
wfile := BFILENAME('BLOB_TEST_ONE', wfname);
SELECT clob_col into lobd2 from blob_table WHERE blobid = 2 for update;
SELECT blob_col into lobd1 from blob_table WHERE blobid = 2 for update;
dbms_lob.fileopen(file, dbms_lob.file_readonly);
dbms_lob.fileopen(wfile, dbms_lob.file_readonly);
amt1 := dbms_lob.getLength(wfile);
dbms_lob.loadfromfile(lobd1, file, amt);
dbms_lob.loadfromfile(lobd2, wfile, amt1);
COMMIT;
dbms_lob.fileclose(file);
dbms_lob.fileclose(wfile);
 
-- Then, import this BLOB into a georaster object.
SELECT georaster INTO geor1 from georaster_table WHERE georid = 14 for update;
sdo_geor.importFrom(geor1,'', 'TIFF', lobd1, 'WORLDFILE', lobd2);
sdo_geor.setModelSRID(geor1, 82394);
UPDATE georaster_table SET georaster = geor1 WHERE georid = 14;
COMMIT; 
END;
/

SDO_GEOR.init

Format

SDO_GEOR.init(

     rasterDataTable IN VARCHAR2 DEFAULT NULL,

     rasterID IN NUMBER DEFAULT NULL

     ) RETURN SDO_GEORASTER;

Description

Initializes an empty GeoRaster object, which must then be registered n the xxx_SDO_GEOR_SYSDATA views (see the Usage Notes).

Parameters

rasterDataTable

Name of the object table of type SDO_RASTER that stores the cell data blocks. Must not contain spaces, period separators, or mixed-case letters in a quoted string; the name is always converted to uppercase when stored in an SDO_GEORASTER object. The RDT should be in the same schema as its associated GeoRaster table. If you do not specify this parameter, GeoRaster generates a unique table name to be used for the raster data table. If you specify this parameter and the table already exists but is not an object table of type SDO_RASTER, an exception is raised.

rasterID

Number that uniquely identifies the blocks of this GeoRaster object in its raster data table. If you do not specify this parameter, a unique sequence number is generated for the ID.

Usage Notes

After initializing the empty GeoRaster object and before performing any operations on the object, you must register it in the xxx_SDO_GEOR_SYSDATA views by inserting the empty GeoRaster object into a GeoRaster table. (The xxx_SDO_GEOR_SYSDATA views are described in Section 2.4. GeoRaster operations are described in Chapter 3.)

This function returns an empty SDO_GEORASTER object with its rasterDataTable and rasterID attributes set. All other attributes of the SDO_GEORASTER object are null.

This function does not require that the specified raster data table exist. However, the table must exist before any data can be inserted into it, and you must create the table.

If a table has multiple GeoRaster object columns, and if for each column you plan to call the SDO_GEOR.init or SDO_GEOR.createBlank function with identical parameter values that contain a null rasterDataTable or rasterID parameter value, do not try to use the SDO_GEOR.init or SDO_GEOR.createBlank function on all such columns with a single INSERT or UPDATE statement. For example, assuming a table named LSAT_TABLE containing the columns (georid NUMBER, type VARCHAR2(32), image_date VARCHAR2(32), image_15m SDO_GEORASTER, image_30m SDO_GEORASTER, image_60m SDO_GEORASTER), do not use a statement like the following:

INSERT INTO lsat_table VALUES(1, 'L1G', '2004-02-25',
  sdo_geor.init('RDT_1'), sdo_geor.init('RDT_1'),
  sdo_geor.init('RDT_1'));

Instead, in cases such as this, do either of the following:

  • Always specify a rasterID parameter value when calling the function. The following example specifies raster ID values of 1, 2, and 3 for the GeoRaster objects being inserted into the last three columns:

    INSERT INTO lsat_table VALUES(1, 'L1G', '2004-02-25',
      sdo_geor.init('RDT_1', 1), sdo_geor.init('RDT_1', 2),
      sdo_geor.init('RDT_1', 3));
    
  • Use the function with only one GeoRaster object with each INSERT or UPDATE statement. The following example inserts a row initializing one GeoRaster object column and specifying the other two as null, and then updates the row twice to initialize the second and third GeoRaster object columns:

    INSERT INTO lsat_table VALUES(1, 'L1G', '2004-02-25',
      sdo_geor.init('RDT_1'), null, null);
    UPDATE lsat_table SET image_30m = sdo_geor.init('RDT_1') 
      WHERE georid = 1;
    UPDATE lsat_table SET image_60m = sdo_geor.init('RDT_1') 
      WHERE georid = 1;
    

Examples

The following example inserts an initialized GeoRaster object into the GEORASTER_TABLE table. The raster data table associated with the GeoRaster object is RDT_1. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

INSERT INTO georaster_table (georid, georaster)
  VALUES (1, sdo_geor.init('RDT_1'));

SDO_GEOR.isBlank

Format

SDO_GEOR.isBlank(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the string TRUE if the GeoRaster object is a blank GeoRaster object, or FALSE if the GeoRaster object is not a blank GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

In a blank GeoRaster object, all cells have the same cell value.

To change the cell value of an existing blank GeoRaster object, use the SDO_GEOR.setBlankCellValue procedure. To return the cell value of a specified GeoRaster object, use the SDO_GEOR.getBlankCellValue function.

Examples

The following example determines whether or not each GeoRaster object in the GEORASTER column of the GEORASTER_TABLE table is a blank GeoRaster object. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

SELECT georid, substr(sdo_geor.isBlank(georaster),1,7) isBlank
  FROM georaster_table;

    GEORID ISBLANK
---------- -------
         2 FALSE
         4 FALSE

SDO_GEOR.isOrthoRectified

Format

SDO_GEOR.isOrthoRectified(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the string TRUE if the GeoRaster object is identified as orthorectified, or FALSE if the GeoRaster object is not identified as orthorectified.

Parameters

georaster

GeoRaster object.

Usage Notes

This function checks the GeoRaster metadata for the object to see if it is specified as orthorectified. It does not check if the object is actually orthorectified. Users are responsible for validating the GeoRaster object and ensuring that orthorectification is performed.

To specify that a GeoRaster object is orthorectified, use the SDO_GEOR.setOrthoRectified procedure.

Examples

The following example checks if the GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table are specified as spatially referenced, rectified, and orthorectified. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

SELECT georid, substr(sdo_geor.isSpatialReferenced(georaster),1,20)
             isSpatialReferenced,
           substr(sdo_geor.isRectified(georaster),1,20) isRectified,
           substr(sdo_geor.isOrthoRectified(georaster),1,20) isOrthoRectified
  FROM georaster_table;

    GEORID ISSPATIALREFERENCED  ISRECTIFIED          ISORTHORECTIFIED
---------- -------------------- -------------------- --------------------
         2 TRUE                 TRUE                 TRUE
         4 TRUE                 TRUE                 FALSE

SDO_GEOR.isRectified

Format

SDO_GEOR.isRectified(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the string TRUE if the GeoRaster object is identified as rectified, or FALSE if the GeoRaster object is not identified as rectified.

Parameters

georaster

GeoRaster object.

Usage Notes

This function checks the GeoRaster metadata for the object to see if it is specified as rectified. Users are responsible for validating the GeoRaster object and ensuring that rectification is performed.

To specify that a GeoRaster object is rectified, use the SDO_GEOR.setRectified procedure.

Examples

The following example checks if the GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table are specified as spatially referenced, rectified, and orthorectified. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

SELECT georid, substr(sdo_geor.isSpatialReferenced(georaster),1,20)
             isSpatialReferenced,
           substr(sdo_geor.isRectified(georaster),1,20) isRectified,
           substr(sdo_geor.isOrthoRectified(georaster),1,20) isOrthoRectified
  FROM georaster_table;

    GEORID ISSPATIALREFERENCED  ISRECTIFIED          ISORTHORECTIFIED
---------- -------------------- -------------------- --------------------
         2 TRUE                 TRUE                 TRUE
         4 TRUE                 TRUE                 FALSE

SDO_GEOR.isSpatialReferenced

Format

SDO_GEOR.isSpatialReferenced(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Returns the string TRUE if the GeoRaster object is spatially referenced, or FALSE if the GeoRaster object is not spatially referenced.

Parameters

georaster

GeoRaster object.

Usage Notes

The GeoRaster object must have been validated.

Examples

The following example checks if the GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table are specified as spatially referenced, rectified, and orthorectified. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

SELECT georid, substr(sdo_geor.isSpatialReferenced(georaster),1,20)
             isSpatialReferenced,
           substr(sdo_geor.isRectified(georaster),1,20) isRectified,
           substr(sdo_geor.isOrthoRectified(georaster),1,20) isOrthoRectified
  FROM georaster_table;

    GEORID ISSPATIALREFERENCED  ISRECTIFIED          ISORTHORECTIFIED
---------- -------------------- -------------------- --------------------
         2 TRUE                 TRUE                 TRUE
         4 TRUE                 TRUE                 FALSE

SDO_GEOR.mergeLayers

Format

SDO_GEOR.mergeLayers(

     targetGeoRaster IN OUT SDO_GEORASTER,

     sourceGeoRaster IN SDO_GEORASTER,

     sourceLayerNumbers IN VARCHAR2 DEFAULT NULL,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.mergeLayers(

     source1GeoRaster IN SDO_GEORASTER,

     source1LayerNumbers IN VARCHAR2,

     source2GeoRaster IN SDO_GEORASTER,

     source2LayerNumbers IN VARCHAR2,

     storageParam IN VARCHAR2,

     outGeoRaster IN OUT SDO_GEORASTER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Merges the layers of two GeoRaster objects, either by appending source layers to a target GeoRaster object (first format) or by performing a union operation (second format).

Parameters

targetGeoRaster

GeoRaster object to which layers in sourceGeoRaster are to be appended. Cannot be the same GeoRaster object as sourceGeoRaster. (Be sure to make a copy of this object before calling this procedure.)

sourceGeoRaster

GeoRaster object in which specified layers are to be appended to targetGeoRaster.

sourceLayerNumbers

String specifying one or more layer numbers of layers in sourceGeoRaster to be appended to targetGeoRaster. Use commas to delimit numbers or ranges, and use a hyphen to indicate a range. Example: '1,3-5,7' for layers 1, 3, 4, 5, and 7.

source1GeoRaster

One GeoRaster object in which specified layers are to be joined in a union operation with layers from source2GeoRaster in the output GeoRaster object outGeoRaster.

source1LayerNumbers

String specifying one or more layer numbers of layers in source1GeoRaster to be joined in a union operation with layers from source2GeoRaster in the output GeoRaster object outGeoRaster. Use commas to delimit numbers or ranges, and use a hyphen to indicate a range. Example: '1,3-5,7' for layers 1, 3, 4, 5, and 7.

source2GeoRaster

One GeoRaster object in which specified layers are to be joined in a union operation with layers from source1GeoRaster in the output GeoRaster object outGeoRaster.

source2LayerNumbers

String specifying one or more layer numbers of layers in source2GeoRaster to be joined in a union operation with layers from source1GeoRaster in the output GeoRaster object outGeoRaster. Use commas to delimit numbers or ranges, and use a hyphen to indicate a range. Example: '1,3-5,7' for layers 1, 3, 4, 5, and 7.

storageParam

A string specifying storage parameters to be applied in creating outGeoRaster. Storage parameters are explained in Section 1.4.1.

outGeoRaster

The new SDO_GEORASTER object that reflects the results of the union operation. Must be either a valid existing GeoRaster object or an empty GeoRaster object. (Empty GeoRaster objects are explained in Section 1.4.3.) Cannot be the same GeoRaster object as source1GeoRaster or source2GeoRaster.

bgValues

Background values for filling partially empty raster blocks. It is only useful when the source GeoRaster object has empty raster blocks and the current operation leads to partially empty raster blocks (see Section 1.4.4). The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filing value used for all bands) or the band dimension size (a different filling value for each band, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) fills the first band with 1, the second band with 5, and the third band with 10.

The filling values must be valid cell values as specified by the target cell depth background values for filling sparse data.

Usage Notes

Note:

Be sure to make a copy of the targetGeoRaster object before you call this procedure, because the changes made to this GeoRaster object might not be reversible after the procedure completes.

The resulting GeoRaster object (georaster or outGeoRaster parameter) must not be the same GeoRaster object as sourceGeoRaster, source1GeoRaster, or source2GeoRaster.

The two GeoRaster objects to be appended or unioned together must have the same spatial dimension sizes and cover the same area. If one of the GeoRaster objects is georeferenced, the other one must also be georeferenced, have the same model SRID and spatial resolutions, and cover the same area in the model space. If neither GeoRaster object is georeferenced, their ultCoordinates must be the same.

Examples

The following example merges specified layers of two GeoRaster objects into a third GeoRaster object, by performing a union operation.

declare
 gr1 sdo_georaster;
 gr2 sdo_georaster;
 gr3 sdo_georaster;
begin
 select georaster into gr1 from georaster_table where georid=1;
 select georaster into gr2 from georaster_table where georid=2;
 insert into georaster_table(georid, georaster) values (3, sdo_geor.init('RDT_1'))
    returning georaster into gr3;
 sdo_geor.mergeLayers(gr1, '3', gr2, '2,1', 'blocking=false', gr3);
 update georaster_table set georaster=gr3 where georid=3;
 commit;
end;
/

SDO_GEOR.mosaic

Format

SDO_GEOR.mosaic(

     georasterTableName IN VARCHAR2,

     georasterColumnName IN VARCHAR2,

     georaster IN OUT SDO_GEORASTER,

     storageParam IN VARCHAR2,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Mosaics GeoRaster objects into one GeoRaster object.

Parameters

georasterTableName

Name of the table containing all source GeoRaster objects.

georasterColumnName

Column of type SDO_GEORASTER in georasterTableName.

georaster

GeoRaster object to hold the result of the mosaic operation. Cannot be the same as any GeoRaster object in georasterColumnName in georasterTableName.

storageParam

A string specifying storage parameters, as explained in Section 1.4.1. If this parameter is null, the resulting GeoRaster object has the same storage parameters (blockSize, cellDepth, interleaving, and compression) as the upper-left corner source GeoRaster object in the model space (if applicable) or cell space.

bgValues

Background values for filling partially empty raster blocks. It is only useful when the current operation leads to partially empty raster blocks (see Section 1.4.4), which could happen when the source GeoRaster objects have empty raster blocks or when the source GeoRaster objects do not cover the whole area. The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filing value used for all bands) or the band dimension size (a different filling value for each band, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) fills the first band with 1, the second band with 5, and the third band with 10.

The filling values must be valid cell values as specified by the target cell depth background values for filling sparse data.

Usage Notes

The source GeoRaster objects must be prepared images or raster data so that they can be mosaicked directly. The GeoRaster objects to be mosaicked must:

  • Not be a mixture of georeferenced and nongeoreferenced objects. Either all of the objects are georeferenced, or none of the objects is georeferenced.

  • Have the same SRID value if the objects are georeferenced, and the georeferencing method must be affine transformation. The affine transformations of the GeoRaster objects must have the same set of coefficients (A, B, D and E) or (b, c, e, f).

  • Have the same number of layers or bands. There is no restriction on the row and column dimension sizes of the source objects; for example, they do not need to be a power of 2.

  • Have the same mapping between band number and layers.

If the GeoRaster objects to be mosaicked are georeferenced, they are co-located according to their georeferencing information. If the GeoRaster objects are not georeferenced, they are co-located according to their ULTCoordinate values. (The ULTCoordinate is explained in Section 1.3.)

If applicable, the resulting GeoRaster object takes the spatial reference metadata information from the upper-left corner source GeoRaster object in the model space. It also takes the cell space and any default storage attributes from the upper-left corner source GeoRaster object in the model space.

If the source GeoRaster objects have empty raster blocks or do not cover the whole area, the mosaicked result GeoRaster object may have empty or partially empty raster blocks (see Section 1.4.4). A result raster block that is not covered by any of the source GeoRaster objects is kept empty. Any partially empty raster blocks are filled with the values specified in the bgValues parameter, or with 0 if the bgValues parameter is not specified.

If the source GeoRaster objects overlap, data of the overlapping area comes from the source object that covers it and that has the largest ultCoordinate in the cell space where all the source objects are co-located.

Any bitmap masks associated with the source GeoRaster objects are not considered, and the bitmapmask parameter is ignored if it is specified in the storageParam string.

If all source GeoRaster objects are blank and have the same blankCellValue value, the resulting GeoRaster object is blank and has that blankCellValue value; otherwise, the resulting GeoRaster object is not blank.

The GeoRaster object to contain the results of the mosaic operation (georaster parameter) must not be any of the source GeoRaster objects (the objects on which the mosaic operation is performed).

Any pyramid data for the source GeoRaster objects is not considered, and the pyramid parameter is ignored if it is specified in the storageParam string.

The mosaic operation performs internal commit operations at regular intervals, and thus it cannot be rolled back. If the operation is interrupted, dangling raster blocks may exist in the raster data table. You can handle dangling raster blocks by maintaining GeoRaster objects and system data in the database, as explained in Section 3.20.

Examples

The following example inserts an initialized GeoRaster object into the GEORASTER_TABLE table, returns the GeoRaster object into a variable named gr, mosaics all the GeoRaster objects in the GROBJ column of a table named GRTAB, and stores the resulting mosaicked GeoRaster object in the same variable. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1. The GRTAB table definition is not important to the example and is not presented here.)

DECLARE
  gr sdo_georaster;
BEGIN
  INSERT INTO georaster_table (georid, georaster) 
      VALUES (12, sdo_geor.init('rdt_1'))
      RETURNING georaster INTO gr;
  sdo_geor.mosaic('grtab', 'grobj', gr, 'blocksize=(512,512,1)');
  UPDATE georaster_table SET georaster=gr WHERE id=12;
END;
/

SDO_GEOR.scaleCopy

Format

SDO_GEOR.scaleCopy(

     inGeoRaster IN SDO_GEORASTER,

     scaleParam IN VARCHAR2,

     resampleParam IN VARCHAR2,

     storageParam IN VARCHAR2,

     outGeoRaster IN OUT SDO_GEORASTER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.scaleCopy(

     inGeoRaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     scaleParam IN VARCHAR2,

     resampleParam IN VARCHAR2,

     storageParam IN VARCHAR2,

     outGeoRaster IN OUT SDO_GEORASTER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Scales a GeoRaster object by enlarging or reducing the image along row and column dimensions, and puts the result into a new object that reflects the scaling.

Parameters

inGeoRaster

The SDO_GEORASTER object on which the scaling operation is to be performed to create the new object (outGeoRaster).

pyramidLevel

A number specifying the pyramid level of the source GeoRaster object.

scaleParam

A string specifying a scaling parameter keyword and its associated value. The keyword must be one of the following:

  • scaleFactor, to reduce or enlarge as a multiple of the original size. This keyword must have a numeric value greater than 0 (zero) (for example, 'scaleFactor=0.75'). A value of 1.0 will not change the current size; a value less than 1 will reduce the image; a value greater than 1 will enlarge the image. The number of cells along each dimension is the original number multiplied by scaleFactor. For example, if the scaleFactor value is 2 and the GeoRaster object has X and Y dimensions, the number of cells along each dimension is doubled.

  • maxDimSize, to specify a size in terms of the maximum number of cells for each dimension. This keyword must have a numeric value for each dimension (for example, 'maxDimSize=(512,512)'). The aspect ratio is not changed.

resampleParam

A string containing the resampling parameters. See the Usage Notes for information about the available keywords and values.

storageParam

A string specifying storage parameters, as explained in Section 1.4.1.

outGeoRaster

The new SDO_GEORASTER object that reflects the results of the scaling operation. Must be either a valid existing GeoRaster object or an empty GeoRaster object. (Empty GeoRaster objects are explained in Section 1.4.3.) Cannot be the same GeoRaster object as inGeoRaster.

bgValues

Background values for filling partially empty raster blocks. It is only useful when the source GeoRaster object has empty raster blocks and the current operation leads to partially empty raster blocks (see Section 1.4.4). The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filing value used for all bands) or the band dimension size (a different filling value for each band, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) fills the first band with 1, the second band with 5, and the third band with 10.

The filling values must be valid cell values as specified by the target cell depth background values for filling sparse data.

Usage Notes

Use this procedure to create a new GeoRaster object reflecting the specified scaling, based on the original GeoRaster object or a specified pyramid level of the GeoRaster object. After you use this procedure, you can check to ensure that the desired changes were made in the copy of the original GeoRaster object, and then discard the original GeoRaster object if you wish.

If you use the format that does not include the pyramidLevel parameter, the scaling is based on the original GeoRaster object (pyramidLevel=0).

If you need to get the scaled cell values, use the procedure described in the Usage Notes for the SDO_GEOR.getCellValue function.

inGeoRaster and outGeoRaster must be different GeoRaster objects.

resampleParam must be a quoted string that contains one or more of the following keywords, each with an appropriate value:

  • resampling (for example, resampling=NN): Specifies the resampling method. Must be one of the following: NN (value of the nearest neighbor cell in the original GeoRaster object), BILINEAR (distance-weighted average of the 4 nearest cells in the original GeoRaster object), AVERAGE4 (simple average of the 4 nearest cells in the original GeoRaster object), AVERAGE16 (simple average of the 16 nearest cells in the original GeoRaster object), CUBIC (cubic convolution of the 16 nearest cells in the original GeoRaster object).

  • nodata (for example, nodata=TRUE): Specifies whether NODATA values and value ranges should be considered during the procedure. Must be either TRUE (NODATA values and value ranges should be considered) or FALSE (NODATA values and value ranges should not be considered). The default value is FALSE. If the value is TRUE and the resampling method is BILINEAR, AVERAGE4, AVERAGE16 or CUBIC, whenever a cell value involved in the resampling calculation is a NODATA value, the result of the resampling is also a NODATA value. The resulting NODATA value is the minimum NODATA value associated with the current raster layer, if multiple NODATA values or value ranges exist.

Any upper-level pyramid data in the input GeoRaster object is not considered during this operation, and the output GeoRaster object has no pyramid data.

After the operation, the row and column ULT coordinates are always set to 0 (zero), even if no scaling is performed (that is, even if scaleFactor=1).

This procedure does not scale along the band dimension.

If the source GeoRaster object is georeferenced with a valid polynomial transformation, the georeferencing information for the resulting GeoRaster object is generated accordingly; otherwise, the result GeoRaster object contains no spatial reference information.

An exception is raised if one or more of the following are true:

  • inGeoRaster is invalid.

  • outGeoRaster has not been initialized.

  • A raster data table for outGeoRaster does not exist and outGeoRaster is not a blank GeoRaster object.

Examples

The following example reduces an image to three-fourths (0.75) size, specifies AVERAGE4 resampling, and specifies a block size of 32 for each dimension in the storage parameters. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  gr1 sdo_georaster;
  gr2 sdo_georaster;
BEGIN
  INSERT INTO georaster_table (georid, georaster) 
    VALUES (21, sdo_geor.init('RDT_1'))
    RETURNING georaster INTO gr2;

  SELECT georaster INTO gr1 FROM georaster_table WHERE georid=2;

  sdo_geor.scaleCopy(gr1, 'scaleFactor=0.75', 'resampling=AVERAGE4',
                     'blocksize=(32,32)', gr2);
  UPDATE georaster_table SET georaster=gr2 WHERE georid=21;
  COMMIT;
END;
/

SDO_GEOR.schemaValidate

Format

SDO_GEOR.schemaValidate(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Validates a GeoRaster object's metadata against the GeoRaster XML schema.

Parameters

georaster

GeoRaster object.

Usage Notes

This function returns the string TRUE if the metadata is valid, a null value if the GeoRaster object or its metadata is null, or one or more Oracle error codes indicating why the metadata is not valid and the exact location of the errors.

Use this function with the SDO_GEOR.validateGeoRaster function. If the SDO_GEOR.validateGeoRaster function identifies a GeoRaster object as invalid with an error code of 13454, the object's metadata is not valid according to the GeoRaster XML schema. If this happens, call the SDO_GEOR.schemaValidate function to get specific information, including the location in the metadata, about the errors.

Examples

The following example validates a GeoRaster object's metadata.

SELECT t.georid,
       sdo_geor.schemavalidate(t.georaster)
  FROM georaster_table t 
  WHERE t.georid = 1;

SDO_GEOR.setBeginDateTime

Format

SDO_GEOR.setBeginDateTime(

     georaster IN OUT SDO_GEORASTER,

     beginTime TIMESTAMP WITH TIME ZONE);

Description

Sets the beginning date and time for raster data collection in the metadata for a GeoRaster object, or deletes the existing value if you specify a null beginTime parameter.

Parameters

georaster

GeoRaster object.

beginTime

Time specification.

Usage Notes

To see the current beginning date and time (if any) in the metadata for the GeoRaster object, use the SDO_GEOR.getBeginDateTime function.

An exception is raised if beginTime is later than the ending date and time specified in the metadata for the GeoRaster object (see the SDO_GEOR.setEndDateTime procedure).

The GeoRaster object is automatically validated after the operation completes.

Examples

The following example sets the beginning and ending dates and times for raster data collection in the metadata for a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setBeginDateTime(grobj, timestamp '2002-11-15 15:00:00');
  sdo_geor.setEndDateTime(grobj, timestamp '2002-11-15 15:00:10');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setBinFunction

Format

SDO_GEOR.setBinFunction(

     georaster IN SDO_GEORASTER,

     layerNumber IN NUMBER

     binFunction IN SDO_NUMBER_ARRAY);

Description

Sets the bin function associated with a layer.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to return the bin type. A value of 0 (zero) indicates the object layer.

binFunction

Bin function as an array whose elements specify the bin type, total number of bins, first bin number, minimum cell value, and maximum cell value. The SDO_NUMBER_ARRAY type is defined as VARRAY(1048576) OF NUMBER. See the Usage Notes for more information and an example.

Usage Notes

A bin function maps values or value ranges of the GeoRaster cells to specific bin numbers, which are all integers. If a bin function of type LINEAR is defined, it is used by the SDO_GEOR.generateStatistics function for calculating statistics on cell values. GeoRaster does not provide interfaces to manipulate and process bin functions.

The binFunction parameter specifies an array of five numbers, which have the following meaning:

  • The first number identifies the bin type, and must be 0 (LINEAR) or 1 (LOGARIGHM).

  • The second number identifies the total number of bins.

  • The third number identifies the number of the first bin.

  • The fourth number is the minimum cell value in the range.

  • The fifth number is the maximum cell value in the range.

For example, if binFunction is SDO_NUMBER_ARRAY(0,10,1,0,511), the bin type is LINEAR, there are 10 bins numbered 1 through 10 (that is, starting at 1), and cell values from 0 through 511 are uniformly distributed to bins 1 through 10.

An exception is raised if layerNumber is null, negative, or greater than the maximum layer number.

Examples

The following example sets the bin function for layer 3 of a specified GeoRaster object, using the binFunction parameter value explained in the Usage Notes.

DECLARE
 gr sdo_georaster;
BEGIN
 SELECT georaster INTO gr FROM georaster_table WHERE georid=4 FOR UPDATE;
 sdo_geor.setBinFunction(gr, 3, sdo_number_array(0,10,1,0,511));
 UPDATE georaster_table SET georaster=gr WHERE georid=4;
END;
/

SDO_GEOR.setBinTable

Format

SDO_GEOR.setBinTable(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     tableName IN VARCHAR2);

Description

Sets the name of the bin table associated with a layer, or deletes the existing value if you specify a null tableName parameter.

Note:

GeoRaster does not perform operations using the bin table in the current release.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to set the bin table name. A value of 0 (zero) indicates the object layer.

tableName

Name of the bin table associated with a layer.

Usage Notes

The GeoRaster object is automatically validated after the operation completes.

This procedure is relevant only if the bin type is EXPLICIT. To retrieve the bin type, use the SDO_GEOR.getBinType function.

To return the bin table for a layer, use the SDO_GEOR.getBinTable function.

See also the information in the Usage Notes for the SDO_GEOR.getBinType function.

An exception is raised if layerNumber is null or invalid for the GeoRaster object, or if tableName is an empty string ('').

Examples

The following example sets BINT1 as the name of the bin table for layer number 3 of a specified GeoRaster object in the GEORASTER_TABLE table, whose definition is presented after Example 1-1 in Section 1.4.1.

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setBinTable(grobj, 3, 'BINT1');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setBitmapMask

Format

SDO_GEOR.setBitmapMask(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     mask IN SDO_GEORASTER,

     NODATAMask IN VARCHAR2 DEFAULT NULL);

Description

Attaches a bitmap mask to a GeoRaster object, or replaces or removes the current bitmap mask.

Parameters

georaster

GeoRaster object.

layerNumber

Layer with which to associate the bitmap mask. A value of 0 (zero) indicates the object layer.

mask

The bitmap mask to be attached to the GeoRaster object. If this parameter is null, any existing bitmap mask associated with the specified layer of the GeoRaster object is removed.

NODATAMask

Specifies 0 (zero, the default) if mask is not to be interpreted as a NODATA mask, or1 if mask is to be interpreted as a NODATA mask.

Usage Notes

If the specified GeoRaster object or layer already has an associated bitmap mask, this procedure replaces it with the specified mask, or removes it if the mask parameter specifies a null value.

If the mask parameter value is not null, the bitmap mask must be a valid 1BIT GeoRaster object with only one band, and the row and column dimension sizes of the bitmap mask must be the same as those of the target GeoRaster object. It cannot be the same GeoRaster object as the input GeoRaster object (georaster parameter).

This procedure raises an exception if the target GeoRaster object is a blank GeoRaster object.

For an explanation of bitmap masks, see Section 1.8.

Examples

The following example uses a GeoRaster object in the table GRTAB (where id=1) as the bitmap mask to be attached to layer number 1 of an GeoRaster object in the GEORASTER_TABLE (where georid=1). The bitmap mask will be interpreted as a NODATA mask.

declare
  gr sdo_georaster;
  mk sdo_georaster;
begin
  select georaster into gr from georaster_table where georid=1 for update;
  select grobj into mk from grtab where id=1;
  sdo_geor.setBitmapMask(gr, 1, mk, 'true');
  update georaster_table set georaster=gr where georid=0;
  commit;
end;
/

SDO_GEOR.setBlankCellValue

Format

SDO_GEOR.setBlankCellValue(

     georaster IN OUT SDO_GEORASTER,

     value IN NUMBER);

Description

Sets (modifies) the cell value to be used for all cells if a specified GeoRaster object is a blank GeoRaster object.

Parameters

georaster

GeoRaster object.

value

Cell value to be used for the blank GeoRaster object. Cannot be a null value.

Usage Notes

In a blank GeoRaster object, all cells have the same cell value.

The GeoRaster object is automatically validated after the operation completes.

To return the blank cell value of a blank GeoRaster object, use the SDO_GEOR.getBlankCellValue function. To determine if a specified GeoRaster object is a blank GeoRaster object, use the SDO_GEOR.isBlank function.

An exception is raised if value is null or inconsistent with the cellDepth specification, or if the GeoRaster object is not blank.

Examples

The following example specifies a value of 255 to be used for all cells in the GeoRaster object column (GEORASTER) in the GEORASTER_TABLE table for the row with an GEORID column value of 1. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=1 FOR UPDATE;
  sdo_geor.setBlankCellValue(grobj, 255);
  UPDATE georaster_table SET georaster = grobj WHERE georid=1;
  COMMIT;
END;
/

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 Section 2.3.2.

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 Section 1.4.1.)

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;
/

SDO_GEOR.setColorMapTable

Format

SDO_GEOR.setColorMapTable(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     tableName IN VARCHAR2);

Description

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

Note:

This procedure registers the colormap table name with GeoRaster; however, GeoRaster does not perform operations using the colormap table in the current release.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to perform the operation.

tableName

Name of the user-defined colormap table. Section 2.3.2 describes colormaps.

Usage Notes

The GeoRaster object is automatically validated after the operation completes.

To return the colormap table for a layer in a GeoRaster object, use the SDO_GEOR.getColorMapTable function.

An exception is raised if layerNumber is null or invalid for the GeoRaster object, or if tableName is an empty string ('').

Examples

The following example sets the colormap table to be null for layer 2 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 Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setColorMapTable(grobj, 2, null);
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setDefaultBlue

Format

SDO_GEOR.setDefaultBlue(

     georaster IN OUT SDO_GEORASTER,

     defaultBlue NUMBER);

Description

Sets the number of the layer to be used for the blue color component (in the RGB color space) for displaying a GeoRaster object, or deletes the existing value if you specify a null defaultBlue parameter.

Parameters

georaster

GeoRaster object.

defaultBlue

Number of the layer to be used for the blue color component (in the RGB color space) for displaying the specified GeoRaster object. Must be greater than 0 (zero) and less than or equal to the highest layer number in the GeoRaster object.

Usage Notes

The default red, green, and blue values are used for true-color displays, not for pseudocolor or grayscale displays. These values are optional, and they are intended for use only when visualizing multilayer or hyperspectral GeoRaster objects.

The GeoRaster object is automatically validated after the operation completes.

An exception is raised if you are trying to set or remove the number of the layer to be used for the blue color component only, or if defaultBlue is not a valid layer number for the GeoRaster object.

Examples

The following example sets the default red, green, and blue color layers for the GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table, and it returns an array with the layer numbers for the red, green, and blue color components for displaying these GeoRaster objects. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setDefaultRed(grobj, 5);
  sdo_geor.setDefaultGreen(grobj, 4);
  sdo_geor.setDefaultBlue(grobj, 3);
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SELECT sdo_geor.getDefaultColorLayer(georaster) FROM georaster_table
  WHERE georid=4;
 
SDO_GEOR.GETDEFAULTCOLORLAYER(GEORASTER)
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(5, 4, 3)
 
1 row selected.

SDO_GEOR.setDefaultColorLayer

Format

SDO_GEOR.setDefaultColorLayer(

     georaster IN OUT SDO_GEORASTER,

     defaultRGB SDO_NUMBER_ARRAY);

Description

Sets the default numbers of the layers to be used for the red, green, and blue color components, respectively, for displaying a GeoRaster object, or deletes the existing values if you specify a null defaultRGB parameter.

Parameters

georaster

GeoRaster object.

defaultRGB

Array of three numbers identifying the red, green, and blue color components, respectively, for displaying the specified GeoRaster object. Each number must be greater than 0 (zero) and less than or equal to the highest layer number in the GeoRaster object.

Usage Notes

The RGB layer numbers specified are used for true-color displays, not for pseudocolor or grayscale displays.

The GeoRaster object is automatically validated after the operation completes.

You can set the layer number for each color component (RGB) by using the SDO_GEOR.setDefaultRed, SDO_GEOR.setDefaultGreen, and SDO_GEOR.setDefaultBlue procedures.

An exception is raised if defaultRGB is of the wrong size or if any elements in it are null or are invalid layer numbers for the GeoRaster object. All elements in the defaultRGB array must be either null or not null; you cannot mix null and non-null array elements, because the three layer numbers must be set or removed at the same time.

Examples

The following example specifies that layer number 1 is to be used for the red, green, and blue color components for displaying the GeoRaster object (GEORASTER column) in the row with an GEORID column value of 2 in the GEORASTER_TABLE table. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=2 FOR UPDATE;
  sdo_geor.setDefaultColorLayer(grobj, sdo_number_array(1,1,1));
  UPDATE georaster_table SET georaster = grobj WHERE georid=2;
  COMMIT;
END;
/

SDO_GEOR.setDefaultGreen

Format

SDO_GEOR.setDefaultGreen(

     georaster IN OUT SDO_GEORASTER,

     defaultGreen NUMBER);

Description

Sets the number of the layer to be used for the green color component (in the RGB color space) for displaying a GeoRaster object, or deletes the existing value if you specify a null defaultGreen parameter.

Parameters

georaster

GeoRaster object.

defaultGreen

Number of the layer to be used for the green color component (in the RGB color space) for displaying the specified GeoRaster object. Must be greater than 0 (zero) and less than or equal to the highest layer number in the GeoRaster object.

Usage Notes

The default red, green, and blue values are used for true-color displays, not for pseudocolor or grayscale displays. These values are optional, and they are intended for use only when visualizing multilayer or hyperspectral GeoRaster objects.

The GeoRaster object is automatically validated after the operation completes.

An exception is raised if you are trying to set or remove the number of the layer to be used for the green color component only, or if defaultGreen is not a valid layer number for the GeoRaster object.

Examples

The following example sets the default red, green, and blue color layers for the GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table, and it returns an array with the layer numbers for the red, green, and blue color components for displaying these GeoRaster objects. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setDefaultRed(grobj, 5);
  sdo_geor.setDefaultGreen(grobj, 4);
  sdo_geor.setDefaultBlue(grobj, 3);
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SELECT sdo_geor.getDefaultColorLayer(georaster) FROM georaster_table
  WHERE georid=4;
 
SDO_GEOR.GETDEFAULTCOLORLAYER(GEORASTER)
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(5, 4, 3)
 
1 row selected.

SDO_GEOR.setDefaultRed

Format

SDO_GEOR.setDefaultRed(

     georaster IN OUT SDO_GEORASTER,

     defaultRed IN NUMBER);

Description

Sets the number of the layer to be used for the red color component (in the RGB color space) for displaying a GeoRaster object, or deletes the existing value if you specify a null defaultRed parameter.

Parameters

georaster

GeoRaster object.

defaultRed

Number of the layer to be used for the red color component (in the RGB color space) for displaying the specified GeoRaster object. Must be greater than 0 (zero) and less than or equal to the highest layer number in the GeoRaster object.

Usage Notes

The default red, green, and blue values are used for true-color displays, not for pseudocolor or grayscale displays. These values are optional, and they are intended for use only when visualizing multilayer or hyperspectral GeoRaster objects.

The GeoRaster object is automatically validated after the operation completes.

An exception is raised if you are trying to set or remove the number of the layer to be used for the red color component only, or if defaultRed is not a valid layer number for the GeoRaster object.

Examples

The following example sets the default red, green, and blue color layers for the GeoRaster objects (GEORASTER column) in the GEORASTER_TABLE table, and it returns an array with the layer numbers for the red, green, and blue color components for displaying these GeoRaster objects. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setDefaultRed(grobj, 5);
  sdo_geor.setDefaultGreen(grobj, 4);
  sdo_geor.setDefaultBlue(grobj, 3);
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SELECT sdo_geor.getDefaultColorLayer(georaster) FROM georaster_table
  WHERE georid=4;
 
SDO_GEOR.GETDEFAULTCOLORLAYER(GEORASTER)
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(5, 4, 3)
 
1 row selected.

SDO_GEOR.setEndDateTime

Format

SDO_GEOR.setEndDateTime(

     georaster IN OUT SDO_GEORASTER,

     endTime TIMESTAMP WITH TIME ZONE);

Description

Sets the ending date and time for raster data collection in the metadata for a GeoRaster object, or deletes the existing value if you specify a null endTime parameter.

Parameters

georaster

GeoRaster object.

endTime

Time specification.

Usage Notes

The GeoRaster object is automatically validated after the operation completes.

To see the current ending date and time (if any) in the metadata for the GeoRaster object, use the SDO_GEOR.getEndDateTime function.

An exception is raised if endTime is earlier than the beginning date and time specified in the metadata for the GeoRaster object (see the SDO_GEOR.setBeginDateTime procedure).

Examples

The following example sets the beginning and ending dates and times for raster data collection in the metadata for a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setBeginDateTime(grobj, timestamp '2002-11-15 15:00:00');
  sdo_geor.setEndDateTime(grobj, timestamp '2002-11-15 15:00:10');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

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 Section 2.3.3.

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 Section 1.4.1.)

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;
/

SDO_GEOR.setGrayScaleTable

Format

SDO_GEOR.setGrayScaleTable(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     tableName IN VARCHAR2);

Description

Sets the grayscale mapping table for a layer in a GeoRaster object, or deletes the existing value if you specify a null tableName parameter.

Note:

This procedure registers the grayscale mapping table name with GeoRaster; however, GeoRaster does not perform operations using the grayscale mapping table in the current release.

Parameters

georaster

GeoRaster object.

layerNumber

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

tableName

Name of the grayscale mapping table for a layer in the specified GeoRaster object.

Usage Notes

Section 2.3.3 describes grayscale display.

The GeoRaster object is automatically validated after the operation completes.

To return the grayscale mapping table for a layer in a GeoRaster object, use the SDO_GEOR.getGrayScaleTable function.

An exception is raised if layerNumber is null or invalid for the GeoRaster object, or if tableName is an empty string ('').

Examples

The following example sets GST1 as the grayscale mapping table 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 Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setGrayScaleTable(grobj, 3, 'GST1');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setHistogramTable

Format

SDO_GEOR.setHistogramTable(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER

     tableName IN VARCHAR2);

Description

Sets the histogram table for a layer in a GeoRaster object.

Note:

This procedure registers the histogram table name with GeoRaster; however, GeoRaster does not perform operations using the histogram table in the current release.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to set the name of the histogram table. A value of 0 (zero) indicates the object layer.

tableName

Name of the histogram table. If this parameter is null, the metadata information for any existing histogram table (but not the actual table) is deleted. If there is no statistics information for the layer, this parameter must be null. The parameter value cannot be an empty string (that is, it cannot be '').

Usage Notes

This procedure specifies a user-defined histogram table. Section 2.3.1 briefly discusses histograms.

To return the name of the histogram table for a layer, use the SDO_GEOR.getHistogramTable function.

An exception is raised if one or more of the following are true:

  • layerNumber is null or invalid for the GeoRaster object,.

  • tableName is an empty string ('').

  • The statistical data associated with the specified layer is not set.

    To set the statistical data for a layer, call the SDO_GEOR.setStatistics procedure.

Examples

The following example sets HIST1 as the histogram table 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 Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setHistogramTable(grobj, 3, 'HIST1');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setID

Format

SDO_GEOR.setID(

     georaster IN OUT SDO_GEORASTER,

     id IN VARCHAR2);

Description

Sets a user-defined identifier to be associated with a GeoRaster object, or deletes the existing value if you specify a null id parameter.

Parameters

georaster

GeoRaster object.

id

ID value to be associated with the GeoRaster object.

Usage Notes

This procedure is useful for assigning unique meaningful alphanumeric identifiers to GeoRaster objects, so that users and applications can easily identify the objects.

The GeoRaster object is automatically validated after the operation completes.

To return the user-defined identifier value for a GeoRaster object, use the SDO_GEOR.getID function.

Examples

The following example sets newid as the user-defined identifier value of the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 2 in the GEORASTER_TABLE table. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=2 FOR UPDATE;
  sdo_geor.setID(grobj, 'newid');
  UPDATE georaster_table SET georaster = grobj WHERE georid=2;
  COMMIT;
END;
/

SDO_GEOR.setLayerID

Format

SDO_GEOR.setLayerID(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     id IN VARCHAR2);

Description

Sets a user-defined identifier to be associated with a layer in a GeoRaster object, or deletes the existing value if you specify a null id parameter.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to perform the operation.

id

ID value to be associated with the specified layer in the GeoRaster object.

Usage Notes

The GeoRaster object is automatically validated after the operation completes.

To return the user-defined identifier value for a layer in a GeoRaster object, use the SDO_GEOR.getLayerID function.

An exception is raised if layerNumber is null or invalid for the GeoRaster object, or if id is null yet the corresponding layer information does exist.

Examples

The following example sets TM_Band_2 as the user-defined identifier value of layer 2 in 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 Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setLayerID(grobj, 2, 'TM_Band_2');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setLayerOrdinate

Format

SDO_GEOR.setLayerOrdinate(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     ordinate IN NUMBER);

Description

Sets the band ordinate value for a specified layer in a GeoRaster object, or deletes the existing value if you specify a null ordinate parameter.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to perform the operation.

ordinate

Band ordinate value of the layer along the band dimension.

Usage Notes

The band ordinate of the layer refers to the physical band that a layer (layerNumber parameter value) is associated with. For the current release, the associations must be as shown in Figure 1-5 in Section 1.5: layer 1 is band 0, layer 2 is band 1, and so on.

The band ordinate for the object layer is ignored by GeoRaster.

The GeoRaster object is automatically validated after the operation completes.

To return the band ordinate value for a layer, use the SDO_GEOR.getLayerOrdinate function.

An exception is raised if layerNumber is null or invalid for the GeoRaster object, if ordinate is null, or if ordinate does not equal layerNumber-1 when layerNumber does not specify the object layer.

Examples

The following example sets the band ordinate value for layer 1 to be 0 (zero) in 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 Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setLayerOrdinate(grobj, 1, 0);
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setModelSRID

Format

SDO_GEOR.setModelSRID(

     georaster IN OUT SDO_GEORASTER,

     srid IN NUMBER);

Description

Sets the coordinate system (SDO_SRID value) for the model (ground) space for a GeoRaster object, or deletes the existing value if you specify a null srid parameter.

Parameters

georaster

GeoRaster object.

srid

Coordinate system. Must be a value from the SRID column of the MDSYS.CS_SRS table if the GeoRaster metadata contains spatial reference information; or must be null (causing no coordinate system associated with the model space) if the GeoRaster metadata does not contain spatial reference information.

Usage Notes

The GeoRaster object is automatically validated after the operation completes.

If the original GeoRaster object had a different model space SRID value, this procedure does not change the raster data itself. In other words, this procedure does not cause any reprojection or resampling on the cell data of the GeoRaster object.

To return the coordinate system (SDO_SRID value) associated with the model space for a GeoRaster object, use the SDO_GEOR.getModelSRID function.

Examples

The following example changes the coordinate system for a GeoRaster object to Longitude / Latitude (WGS 66), which is the coordinate system associated with SRID value 82394 in the MDSYS.CS_SRS system table. (The example refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setModelSRID(grobj, 82394);
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setOrthoRectified

Format

SDO_GEOR.setOrthoRectified(

     georaster IN OUT SDO_GEORASTER,

     isOrthoRectified IN VARCHAR2);

Description

Specifies whether or not a GeoRaster object is orthorectified, or deletes the existing value if you specify a null isOrthoRectified parameter.

Parameters

georaster

GeoRaster object.

isOrthoRectified

Specify TRUE to specify that the GeoRaster object is orthorectified, FALSE to specify that the GeoRaster object is not orthorectified, or null if the GeoRaster metadata does not contain spatial reference information. Must be TRUE or FALSE (case-insensitive) if the GeoRaster metadata contains spatial reference information.

Usage Notes

This procedure modifies the GeoRaster metadata for the object. It does not actually orthorectify the object. Users are responsible for ensuring that orthorectification is performed.

The GeoRaster object is automatically validated after the operation completes.

To be set as orthorectified, a GeoRaster object must be spatially referenced and rectified.

Examples

The following example identifies the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table as orthorectified. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setOrthoRectified(grobj, 'TRUE');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setRasterType

Format

SDO_GEOR.setRasterType(

     georaster IN OUT SDO_GEORASTER,

     rasterType IN NUMBER);

Description

Sets the raster type of a GeoRaster object.

Parameters

georaster

GeoRaster object.

rasterType

Numeric value to be set as the rasterType attribute of the GeoRaster object. Must be a valid 5-digit numeric value, in the format described in Section 2.1.1.

Usage Notes

The GeoRaster object is automatically validated after the operation completes.

An exception is raised if rasterType is null or if the first three digits of the existing rasterType value are changed.

Examples

The following example sets the rasterType attribute value of a GeoRaster object to 20001. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=2 FOR UPDATE;
  sdo_geor.setRasterType(grobj, 20001);
  UPDATE georaster_table SET georaster = grobj WHERE georid=2;
  COMMIT;
END;
/

SDO_GEOR.setRectified

Format

SDO_GEOR.setRectified(

     georaster IN OUT SDO_GEORASTER,

     isRectified IN VARCHAR2);

Description

Specifies whether or not a GeoRaster object is rectified, or deletes the existing value if you specify a null isRectified parameter.

Parameters

georaster

GeoRaster object.

isRectified

Specify TRUE to specify that the GeoRaster object is rectified, FALSE to specify that the GeoRaster object is not rectified, or null if the GeoRaster metadata does not contain spatial reference information. Must be TRUE or FALSE (case-insensitive) if the GeoRaster metadata contains spatial reference information.

Usage Notes

This procedure modifies the GeoRaster metadata for the object. It does not actually rectify the object. Users are responsible for ensuring that rectification is performed.

The GeoRaster object is automatically validated after the operation completes.

A GeoRaster object must be spatially referenced if you want to set isRectified to TRUE (see the SDO_GEOR.setSpatialReferenced procedure).

Examples

The following example identifies the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table as not rectified. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setRectified(grobj, 'false');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setScaling

Format

SDO_GEOR.setScaling(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     scalingFunc IN SDO_NUMBER_ARRAY);

Description

Sets the scaling function associated with a layer, or deletes the existing value if you specify a null scalingFunc parameter.

Note:

GeoRaster does not perform operations using the scaling function in the current release.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to perform the operation.

scalingFunc

An array of numeric values, with one value for each coefficient in the scaling function. The scaling function is as follows:

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

The order of the coefficients is: a0, a1, b0, b1.

Usage Notes

The GeoRaster object is automatically validated after the operation completes.

An exception is raised if layerNumber is null or invalid for the GeoRaster object; if scalingFunc is of the wrong array size; if one of a0, a1, b0, and b1 is null; or if both b0 and b1 are 0 (zero).

Examples

The following example sets the coefficients of the scaling function for layer 2 of a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setScaling(grobj, 2, sdo_number_array(1, 0.5, 1, 0));
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setSourceInfo

Format

SDO_GEOR.setSourceInfo(

     georaster IN OUT SDO_GEORASTER,

     sourceInfo IN VARCHAR2);

Description

Sets the source information for a GeoRaster object, or deletes the existing value if you specify a null sourceInfo parameter.

Parameters

georaster

GeoRaster object.

sourceInfo

String with source information. Cannot exceed 4096 characters.

Usage Notes

The specified sourceInfo string is stored in the <sourceInfo> element in the metadata for the GeoRaster object (described in Appendix A).

This procedure replaces any existing source information value or values. If you want to keep any existing values and add one or more values, use the SDO_GEOR.addSourceInfo procedure.

Examples

The following example sets and adds some source information for a specified GeoRaster object, and then retrieves the information.

declare
 gr sdo_georaster;
begin
 select georaster into gr from georaster_table where georid=1 for update;
 sdo_geor.setSourceInfo(gr, 'Copyright (c) 2002, 2007, Oracle Corporation.');
 sdo_geor.addSourceInfo(gr, 'All rights reserved.');
 update georaster_table set georaster=gr where georid=1;
end;
/
 
select * from table(select sdo_geor.getSourceInfo(georaster) from georaster_table where id=1);
 
COLUMN_VALUE
--------------------------------------------------------------------------------
Copyright (c) 2002, 2007, Oracle Corporation.
All rights reserved.

SDO_GEOR.setSpatialReferenced

Format

SDO_GEOR.setSpatialReferenced(

     georaster IN OUT SDO_GEORASTER,

     isReferenced IN VARCHAR2);

Description

Specifies whether or not a GeoRaster object is spatially referenced, or deletes the existing value if you specify a null isReferenced parameter.

Parameters

georaster

GeoRaster object.

isReferenced

Specify TRUE to specify that the GeoRaster object is spatially referenced, FALSE to specify that the GeoRaster object is not spatially referenced, or null if the GeoRaster metadata does not contain spatial reference information. Must be TRUE or FALSE (case-insensitive) if the GeoRaster metadata contains spatial reference information.

Usage Notes

This procedure sets the GeoRaster object to be spatially referenced or not spatially referenced.

The GeoRaster object is automatically validated after the operation completes.

Examples

The following example sets the GeoRaster object (GEORASTER column) in the row with the GEORID column value of 4 in the GEORASTER_TABLE table as not spatially referenced. (The GEORASTER_TABLE table definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setSpatialReferenced(grobj, 'FALSE');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setSpatialResolutions

Format

SDO_GEOR.setSpatialResolutions(

     georaster IN OUT SDO_GEORASTER,

     resolutions IN SDO_NUMBER_ARRAY);

Description

Sets the spatial resolution value along each spatial dimension of a GeoRaster object, or deletes the existing values if you specify a null resolutions parameter.

Parameters

georaster

GeoRaster object.

resolutions

An array of numeric values, one for each spatial dimension. Each value indicates the number of units of measurement associated with the data area represented by that spatial dimension of a pixel. For example, if the spatial resolution values are (10,10) and the unit of measurement for the ground data is meters, each pixel represents an area of 10 meters by 10 meters.

Usage Notes

The GeoRaster object is automatically validated after the operation completes.

If resolutions is not null and if the GeoRaster metadata currently does not contain spatial reference information, this procedure adds spatial reference information with minimum default values.

See also the Usage Notes for the SDO_GEOR.getSpatialResolutions function.

Examples

The following example sets the spatial resolution values along the column and row (X and Y) dimensions of a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setSpatialResolutions(grobj, sdo_number_array(28.5,28.5));
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setSpectralResolution

Format

SDO_GEOR.setSpectralResolution(

     georaster IN OUT SDO_GEORASTER,

     resolution IN NUMBER);

Description

Sets the spectral resolution of a GeoRaster object if it is a hyperspectral or multiband image, or deletes the existing value if you specify a null resolution parameter.

Parameters

georaster

GeoRaster object.

resolution

Spectral resolution value. Must be null if the GeoRaster metadata does not contain band reference information.

Usage Notes

Taken together, the spectral unit and spectral resolution identify the wavelength interval for a band. For example, if the spectral resolution value is 2 and the spectral unit value is MILLIMETER, the wavelength interval for a band is 2 millimeters.

The GeoRaster object is automatically validated after the operation completes.

To return the spectral resolution for a GeoRaster object, use the SDO_GEOR.getSpectralResolution function.

Examples

The following example sets 0.5 as the spectral resolution value for 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 Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setSpectralResolution(grobj, 0.5);
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setSpectralUnit

Format

SDO_GEOR.setSpectralUnit(

     georaster IN OUT SDO_GEORASTER,

     unit IN VARCHAR2);

Description

Sets the unit of measurement for identifying the wavelength interval for a band, or deletes the existing value if you specify a null unit parameter.

Parameters

georaster

GeoRaster object.

unit

Spectral unit. Must be one of the following values if the GeoRaster metadata contains band reference information: METER, MILLIMETER, MICROMETER, NANOMETER. Must be null if the GeoRaster metadata does not contain band reference information.

Usage Notes

Taken together, the spectral unit and spectral resolution identify the wavelength interval for a band. For example, if the spectral resolution value is 2 and the spectral unit value is MILLIMETER, the wavelength interval for a band is 2 millimeters.

The GeoRaster object is automatically validated after the operation completes.

To return the spectral unit for a GeoRaster object, use the SDO_GEOR.getSpectralUnit function.

Examples

The following example sets MICROMETER as the spectral unit for 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 Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setSpectralUnit(grobj, 'micrometer');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setSRS

Format

SDO_GEOR.setSRS(

     georaster IN OUT SDO_GEORASTER,

     srs IN SDO_GEOR_SRS);

Description

Sets the spatial reference information of a GeoRaster object, or deletes the existing information if you specify a null srs parameter.

Parameters

georaster

GeoRaster object.

srs

An object of type SDO_GEOR_SRS. The SDO_GEOR_SRS object type and its constructor are described in Section 2.3.5.

In this object, isReferenced, isRectified, and isOrthoRectified must be TRUE or FALSE (case-insensitive); spatialResolution must be an array of the correct size; the spatial tolerance cannot be negative; CoordLocation must be 0 or 1; and the polynomial parameters cannot be null.

Usage Notes

This procedure can be used to set the GeoRaster SRS for any functional fitting georeferencing models, including the affine transformation, DLT, and RPC models.

The GeoRaster object is automatically validated after the operation completes.

To return the SDO_GEOR_SRS information for a GeoRaster object, use the SDO_GEOR.getSRS function.

Examples

The following examples specify spatial reference attributes of a GeoRaster object, and updates the GeoRaster object. (They refer to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.) Notes explain the operations in more detail.

The first example shows how to set an affine transformation model to a GeoRaster object.

DECLARE
  grobj sdo_georaster;
  srs   sdo_geor_srs;
 
BEGIN
 
SELECT georaster INTO grobj FROM georaster_table WHERE georid=4;
srs := sdo_geor_srs('TRUE', 'TRUE', null, 82262,
                       sdo_number_array(28.5, 28.5),0.5,0,
                       0,0,0,0,0,1,1,1,1,1,0,0,0,
                       SDO_NUMBER_ARRAY(1, 2, 1, 3, 32631.5614, 0, -.03508772),
                       SDO_NUMBER_ARRAY(1, 0, 0, 1, 1),
                       SDO_NUMBER_ARRAY(1, 2, 1, 3, -7894.7544, .03508772, 0),
                       SDO_NUMBER_ARRAY(1, 0, 0, 1, 1));
sdo_geor.setSRS(grobj, srs);
 
UPDATE georaster_table SET georaster = grobj WHERE georid=4;
COMMIT;
END;
/

In the preceding example, the GeoRaster object has the following affine transformation:

row = 32631.5614 + 0 * x + (-0.03508772) * y
col = -7894.7544 + 0.03508772 * x + 0 * y

To use the generic functional fitting georeferencing model described in Section 1.6.1, the values of SRS attributes are as follows:

xOff=yOff=zOff=0
rowOff=columnOff=0
xScale=yScale=zScale=1
rowScale=columnScale=1
polynomial p : pType=1, nVars=2, order=1, nCoefficients= 3
polynomial q : pType=1, nVars=0, order=0, nCoefficients= 1
polynomial r : pType=1, nVars=2, order=1, nCoefficients= 3
polynomial s : pType=1, nVars=0, order=0, nCoefficients= 1
 
rowNumerator = 32631.5614, 0, -0.03508772
rowDenominator =  1
columnNumerator = -7894.7544, 0.03508772, 0
columnDenominator = 1

In the SRS structure, the rowNumerator, rowDenominator, columnNumerator, and columnDenominator elements are used to specify pType, nVars, order, and nCoefficients, and the remaining elements are used to specify coefficients of each polynomial.

The second example shows how to set a DLT model to a GeoRaster object. In a typical photogrammetry application, the interior orientation parameters and exterior orientation parameters of an oriented digital aerial photo can be used to derive a DLT model, which is widely used to simplify and approximate the rigorous model. The following is an example of a DLT model derived from a standard frame camera model.

row = (-46507111.2127784 + 65.81484127*X + 13.13186856*Y - 49.62133265*Z) / (-41.47013322 + 0.00004128*X + 0.00009740*Y - 0.00655704*Z)

col = (-5259855.00453679 - 12.07452653*X + 66.23319061*Y - 49.45792766*Z) / (-41.47013322 + 0.00004128*X + 0.00009740*Y - 0.00655704*Z)
 

For this example, the corresponding GeoRaster SRS parameters and coefficients are:

rowOff=0, colOff=0; rowScale = colScale = 1;
xOff = 0, yOff = 0, zOff = 0; xScale = yScale = zScale =1;
polynomial p : pType=1, nVars=3, order=1, nCoefficients= 4
polynomial q : pType=1, nVars=3, order=1, nCoefficients= 4
polynomial r : pType=1, nVars=3, order=1, nCoefficients= 4
polynomial s : pType=1, nVars=3, order=1, nCoefficients= 4
 
rowNumerator = -5259855.00453679, -12.07452653, 66.23319061, -49.45792766
rowDenominator = -41.47013322, 0.00004128, 0.00009740, -0.00655704
columnNumerator = -46507111.2127784, 65.81484127, 13.13186856, -49.62133265
columnDenominator = -41.47013322, 0.00004128, 0.00009740, -0.00655704

The following sets up the DLT model for the GeoRaster object. It uses the SDO_GEOR_SRS constructor to create an instance of the SDO_GEOR_SRS type, and then sets the appropriate attributes.

DECLARE
   grobj sdo_georaster;
   srs sdo_geor_srs;
BEGIN
   SELECT georaster INTO grobj FROM georaster_table WHERE georid = 101;
 
   -- Initiate the SRS object.
   srs:=sdo_geor_srs();
 
   -- Fill the parameters of the SRS object.
   srs.isReferenced := 'TRUE';
   srs.isRectified := 'FALSE';
   srs.isOrthoRectified := 'FALSE';
   srs.srid := 7406;
   srs.spatialResolution := sdo_number_array(0.07, 0.07);
   srs.coordLocation := 1;
   srs.rowOff := 0;
   srs.columnOff := 0;
   srs.xOff := 0;
   srs.yOff := 0;
   srs.zOff := 0;
   srs.rowScale := 1;
   srs.columnScale := 1;
   srs.xScale := 1;
   srs.yScale := 1;
   srs.zScale := 1;
   srs.rowNumerator := SDO_NUMBER_ARRAY(1, 3, 1, 4, -5259855.00453679,
     -12.07452653,66.23319061,-49.45792766);
   srs.rowDenominator := SDO_NUMBER_ARRAY(1, 3, 1, 4, -41.4701332195,
     0.0000412763, 0.0000974018, -0.0065570398);
   srs.columnNumerator := SDO_NUMBER_ARRAY(1, 3, 1, 4,
     -46507111.2127784, 65.81484127, 13.13186856, -49.62133265);
   srs.columnDenominator := SDO_NUMBER_ARRAY(1, 3, 1, 4,
     -41.4701332195, 0.0000412763, 0.0000974018, -0.0065570398);
 
   -- Set the SRS metadata to the GeoRaster object.
   sdo_geor.setSRS(grobj,srs);
   UPDATE georaster_table SET georaster = grobj WHERE georid= 101;
   COMMIT;
 
END;
/

SDO_GEOR.setStatistics

Format

SDO_GEOR.setStatistics(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     statistics IN SDO_NUMBER_ARRAY);

or

SDO_GEOR.setStatistics(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     statistics IN SDO_NUMBER_ARRAY,

     histogram IN SDO_GEOR_HISTOGRAM,

     samplingFactor IN NUMBER DEFAULT 1,

     samplingWindow IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.setStatistics(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     statistics IN SDO_NUMBER_ARRAY,

     histogram IN SDO_GEOR_HISTOGRAM,

     samplingFactor IN NUMBER DEFAULT 1,

     samplingWindow IN SDO_GEOMETRY DEFAULT NULL);

Description

Sets statistical data associated with a layer.

Parameters

georaster

GeoRaster object.

layerNumber

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

statistics

An array with the following numeric values: MIN, MAX, MEAN, MEDIAN, MODEVALUE, STD. You must specify non-null values for all values in the array. The SDO_NUMBER_ARRAY type is defined as VARRAY(1048576) OF NUMBER.

If this parameter is null, all statistical information associated with the layer is deleted.

histogram

Histogram of type SDO_GEOR_HISTOGRAM. Section 2.3.1 describes this object type and briefly discusses histograms.

samplingFactor

Sampling factor. The denominator n in 1/n, representing the number of cells sampled in computing the statistics. For example, if samplingFactor is 4, one-fourth of the cells were sampled. The default is 1; that is, all cells were sampled. The higher the value, the less accurate the statistics are likely to be, but the more quickly they were computed.

samplingWindow

Sampling window: a rectangular window for which to set statistics, specified either as a numeric array with the lower-left and upper-right coordinates or as an SDO_GEOMETRY object. The SDO_NUMBER_ARRAY type is defined as VARRAY(1048576) OF NUMBER. The window must be inside the extent in cell space. The default for this parameter is the entire image.

Usage Notes

This procedure sets statistical data described by the <statisticDatasetType> element in the GeoRaster metadata XML schema, which is described in Appendix A.

If histogram is specified as null, and if there is an existing histogram and you set the statistics using a different sampling factor or sampling window, the existing histogram is removed.

Contrast this procedure, in which you specify the statistics to be set, with the SDO_GEOR.generateStatistics function, which causes GeoRaster to compute and set the statistics.

To retrieve the statistical data associated with a layer, use the SDO_GEOR.getStatistics function.

An exception is raised if layerNumber is null or invalid for the GeoRaster object, or if statistics is of the wrong array size or has any null array elements.

Examples

The following example sets the statistical data for layer 0 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 Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setStatistics(grobj, 0, SDO_NUMBER_ARRAY(0, 255, 100, 127, 95, 25));
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.setULTCoordinate

Format

SDO_GEOR.setULTCoordinate(

     georaster IN OUT SDO_GEORASTER,

     ultCoord IN SDO_NUMBER_ARRAY);

Description

Sets the cell coordinate values of the upper-left corner of a GeoRaster object, or deletes the existing values if you specify a null ultCoord parameter.

Parameters

georaster

GeoRaster object.

ultCoord

An array of two numbers (row and column ordinates) or three numbers (row, column, and band ordinates). If you specify three numbers, the third one (band number) must be 0. For more information about the ULTCoordinate, see Section 1.3.

Usage Notes

If the metadata contains spatial reference information and the GeoRaster object is georeferenced, the spatial reference information is checked for validity. If it is valid, the spatial reference information including the georeferencing information is updated and adjusted according to the new ULT coordinates; otherwise, an exception is raised.

To return the upper-left coordinate values for a GeoRaster object, use the SDO_GEOR.getULTCoordinate function.

An exception is raised if ultCoord is null or of the wrong array size or has any null array elements.

Examples

The following example sets the row and column ordinates of the upper-left corner of a GeoRaster object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=1 FOR UPDATE;
  sdo_geor.setULTCoordinate(grobj, sdo_number_array(100, 100));
  UPDATE georaster_table SET georaster = grobj WHERE georid=1;
  COMMIT;
END;
/

SDO_GEOR.setVAT

Format

SDO_GEOR.setVAT(

     georaster IN OUT SDO_GEORASTER,

     layerNumber IN NUMBER,

     vatName IN VARCHAR2);

Description

Sets the name of the value attribute table (VAT) associated with a layer of a GeoRaster object, or deletes the existing value if you specify a null vatName parameter.

Parameters

georaster

GeoRaster object.

layerNumber

Number of the layer for which to perform the operation.

vatName

Name of the value attribute table.

Usage Notes

The GeoRaster object is automatically validated after the operation completes.

For more information about value attribute tables, see Section 1.2.3.

To return the name of the value attribute table associated with a layer of a GeoRaster object, use the SDO_GEOR.getVAT function.

An exception is raised if layerNumber is null or invalid for the GeoRaster object, or if vatName is an empty string ('').

Examples

The following example specifies VATT1 as the value attribute table to be associated with 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 Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setVAT(grobj, 3, 'VATT1');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/ 

SDO_GEOR.setVersion

Format

SDO_GEOR.setVersion(

     georaster IN OUT SDO_GEORASTER,

     majorVersion IN VARCHAR2,

     minorVersion IN VARCHAR2);

Description

Sets the user-specified version of a GeoRaster object.

Parameters

georaster

GeoRaster object.

majorVersion

String representing the major version of the GeoRaster object. For example, if the complete version string is 15a.beta1, specify the majorVersion value as 15a.

If the parameter value is null, any existing majorVersion value in the GeoRaster object is deleted.

minorVersion

String representing the minor version of the GeoRaster object. For example, if the complete version string is 15a.beta1, specify the minorVersion value as beta1.

If the parameter value is null, any existing minorVersion value in the GeoRaster object is deleted.

Usage Notes

The major and minor version strings can reflect any versioning scheme that you choose. The majorVersion and minorVersion values can be any string, except that neither can be an empty string (that is, neither can be '').

To retrieve the version string for a GeoRaster object, use the SDO_GEOR.getVersion function, which returns the version in the format major-version.minor-version.

Examples

The following example sets 15a.beta1 as the version for 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 Section 1.4.1.)

DECLARE
  grobj sdo_georaster;
BEGIN
  SELECT georaster INTO grobj FROM georaster_table WHERE georid=4 FOR UPDATE;
  sdo_geor.setVersion(grobj, '15a', 'beta1');
  UPDATE georaster_table SET georaster = grobj WHERE georid=4;
  COMMIT;
END;
/

SDO_GEOR.subset

Format

SDO_GEOR.subset(

     inGeoRaster IN SDO_GEORASTER,

     cropArea IN SDO_GEOMETRY,

     layerNumbers IN VARCHAR2,

     storageParam IN VARCHAR2,

     outGeoRaster IN OUT SDO_GEORASTER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.subset(

     inGeoRaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     cropArea IN SDO_GEOMETRY,

     layerNumbers IN VARCHAR2,

     storageParam IN VARCHAR2,

     outGeoRaster IN OUT SDO_GEORASTER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.subset(

     inGeoRaster IN SDO_GEORASTER,

     cropArea IN SDO_NUMBER_ARRAY,

     bandNumbers IN VARCHAR2,

     storageParam IN VARCHAR2,

     outGeoRaster IN OUT SDO_GEORASTER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.subset(

     inGeoRaster IN SDO_GEORASTER,

     pyramidLevel IN NUMBER,

     cropArea IN SDO_NUMBER_ARRAY,

     bandNumbers IN VARCHAR2,

     storageParam IN VARCHAR2,

     outGeoRaster IN OUT SDO_GEORASTER,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Performs either or both of the following operations: (1) spatial crop, cut, or clip, or (2) layer or band subset or duplicate.

Parameters

inGeoRaster

The SDO_GEORASTER object on which the operation or operations are to be performed.

pyramidLevel

A number specifying the pyramid level of the source GeoRaster object.

cropArea

Crop area definition. 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.

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.

layerNumbers

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).

bandNumbers

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).

storageParam

A string specifying storage parameters, as explained in Section 1.4.1.

outGeoRaster

The new SDO_GEORASTER object. Must be either a valid existing GeoRaster object or an empty GeoRaster object. (Empty GeoRaster objects are explained in Section 1.4.3.) Cannot be the same GeoRaster object as inGeoRaster.

bgValues

Background values for filling partially empty raster blocks. It is only useful when the source GeoRaster object has empty raster blocks and the current operation leads to partially empty raster blocks (see Section 1.4.4). The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filing value used for all bands) or the band dimension size (a different filling value for each band, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) fills the first band with 1, the second band with 5, and the third band with 10.

The filling values must be valid cell values as specified by the target cell depth background values for filling sparse data.

Usage Notes

This procedure has a variety of possible uses. For example, you can call it to crop a small area or obtain a subset of a few layers of a GeoRaster object, you can duplicate layers, and you can specify storage parameters such as blocking and interleaving for the resulting object.

If you use the format that includes the pyramidLevel parameter and specify a value greater than zero (0), the cropping is done based on the specified pyramid level of the source GeoRaster object; otherwise, the cropping is done based on the original source GeoRaster object (pyramidLevel = 0).

If the source GeoRaster object is georeferenced and the pyramidLevel parameter value is greater than 0, the georeferencing information is generated for the resulting GeoRaster object only when the georeference is a valid polynomial transformation.

Any upper-level pyramid data in the input GeoRaster object is not considered in this operation, and the output GeoRaster object has no pyramid data.

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 window 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 Section 1.3.)

If the cropArea parameter specifies a geodetic MBR, it cannot cross the date line meridian. For information about geodetic MBRs, see Oracle Spatial Developer's Guide.

inGeoRaster and outGeoRaster must be different GeoRaster objects.

Only the overlapping portion of the specified window of interest and the source GeoRaster object's spatial extent is copied.

An exception is raised if one or more of the following are true:

  • inGeoRaster is invalid.

  • outGeoRaster has not been initialized.

  • A raster data table for outGeoRaster does not exist and outGeoRaster is not a blank GeoRaster object.

  • The specified window of interest falls outside of the GeoRaster object's spatial extent.

Examples

The following example creates a GeoRaster object that contains only specified bands from a specified window from the original object. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Section 1.4.1.)

DECLARE
  gr1 sdo_georaster;
  gr2 sdo_georaster;
BEGIN
  INSERT INTO georaster_table (georid, georaster)
    VALUES (41, sdo_geor.init('RDT_1'))
    RETURNING georaster INTO gr2;

  SELECT georaster INTO gr1 FROM georaster_table WHERE georid=4;

  sdo_geor.subset(gr1, sdo_geometry(2003, NULL, NULL,
                               sdo_elem_info_array(1, 1003, 3),
                               sdo_ordinate_array(0,256,255,511)),
                  '3,1-2', null, gr2);
  UPDATE georaster_table SET georaster=gr2 WHERE georid=41;
  COMMIT;
END;
/

SDO_GEOR.updateRaster

Format

SDO_GEOR.updateRaster(

     targetGeoRaster IN OUT SDO_GEORASTER,

     targetPyramidLevel IN NUMBER,

     targetLayerNumbers IN VARCHAR2,

     targetArea IN SDO_GEOMETRY,

     sourceGeoRaster IN SDO_GEORASTER,

     sourcePyramidLevel IN NUMBER,

     sourceLayerNumbers IN VARCHAR2,

     updateUpperPyramids IN VARCHAR2,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.updateRaster(

     targetGeoRaster IN OUT SDO_GEORASTER,

     targetPyramidLevel IN NUMBER,

     targetBandNumbers IN VARCHAR2,

     targetArea IN SDO_NUMBER_ARRAY,

     sourceGeoRaster IN SDO_GEORASTER,

     sourcePyramidLevel IN NUMBER,

     sourceBandNumbers IN VARCHAR2,

     updateUpperPyramids IN VARCHAR2,

     bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Updates a specified pyramid of a specified area or the overlapping parts of one GeoRaster object with selected pyramid and selected bands or layers of another GeoRaster object.

Parameters

targetGeoRaster

GeoRaster object to be updated. (Be sure to make a copy of this object before you update it.)

targetPyramidLevel

Number specifying the pyramid level of the target GeoRaster object to be updated.

targetLayerNumbers

String specifying one or more layer numbers of layers in targetGeoRaster to be updated. Use commas to delimit numbers or ranges, and use a hyphen to indicate a range. Example: '1,3-5,7' for layers 1, 3, 4, 5, and 7.

targetBandNumbers

String specifying one or more band numbers of bands in targetGeoRaster to be updated. Use commas to delimit numbers or ranges, and use a hyphen to indicate a range. Example: '0,3-5,7' for bands 0, 3, 4, 5, and 7. Any bands that you specify for this parameter must be compatible with the bands to be updated in the target GeoRaster object.

targetArea

Area to be updated in targetGeoRaster: a rectangular window, specified either as a numeric array with the lower-left and upper-right coordinates or as an SDO_GEOMETRY object. The SDO_NUMBER_ARRAY type is defined as VARRAY(1048576) OF NUMBER.

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 target area; see also the Usage Notes for SDO_SRID requirements.

If targetArea is of type SDO_GEOMETRY, use the targetLayerNumbers and sourceLayerNumbers parameters to specify one or more layer numbers; if targetArea is of type SDO_NUMBER_ARRAY, use the targetBandNumbers and sourceBandNumbers parameters to specify one or more band numbers.

If the specified area does not intersect with the spatial extent of targetGeoRaster, no update is performed. If this parameter is specified as null, all of the overlapping area is updated.

sourceGeoRaster

GeoRaster object in which specified layers are to be used to update targetGeoRaster.

sourcePyramidLevel

Number specifying the pyramid level of the sourceGeoRaster object.

sourceLayerNumbers

String specifying one or more layer numbers of layers in sourceGeoRaster to be used to update targetGeoRaster. Use commas to delimit numbers or ranges, and use a hyphen to indicate a range. Example: '1,3-5,7' for layers 1, 3, 4, 5, and 7.

Any layers that you specify for this parameter must be compatible with the layers to be updated in the target GeoRaster object.

sourceBandNumbers

String specifying one or more band numbers of bands in sourceGeoRaster to be used to update targetGeoRaster. Use commas to delimit numbers or ranges, and use a hyphen to indicate a range. Example: '0,3-5,7' for bands 0, 3, 4, 5, and 7.

Any bands that you specify for this parameter must be compatible with the bands to be updated in the target GeoRaster object.

updateUpperPyramids

String (TRUE or FALSE) specifying whether to update upper-level pyramids. (This parameter has no default value; you should always specify it.)

bgValues

Background values for filling partially empty raster blocks. It is only useful when the source GeoRaster object has empty raster blocks and the current operation leads to partially empty raster blocks (see Section 1.4.4). The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filing value used for all bands) or the band dimension size (a different filling value for each band, respectively). For example, SDO_NUMBER_ARRAY(1,5,10) fills the first band with 1, the second band with 5, and the third band with 10.

The filling values must be valid cell values as specified by the target cell depth background values for filling sparse data.

Usage Notes

Note:

Be sure to make a copy of the targetGeoRaster object before you call this procedure, because the changes made to this GeoRaster object might not be reversible after the procedure completes.

If both GeoRaster objects are georeferenced, they must use the same coordinate system, have the same cell depth, and have the same spatial resolutions at the specified pyramid levels; however, the targetPyramidLevel and sourcePyramidLevel values can be different. If both GeoRaster objects are not georeferenced, the ULTCoordinates will be considered to co-locate them into each other.

The two GeoRaster objects can have different dimensions and sizes.

If the targetArea 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 window parameter geometry and the model space are different, the window 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 Section 1.3.)

If the targetArea parameter specifies a geodetic MBR, it cannot cross the date line meridian. For information about geodetic MBRs, see Oracle Spatial Developer's Guide.

Any existing bitmap masks are not updated.

If the source GeoRaster object is not large enough to fill in the target area, the uncovered area will not be updated.

If the target GeoRaster object has pyramids or is compressed, or both, the updates will be reflected in the pyramids and the compression.

To update upper-level pyramids, you must specify the updateUpperPyramids parameter as 'TRUE'. (This parameter has no default value; you should always specify 'TRUE' or 'FALSE'.)

Examples

The following example updates a specified area in band 1 of the specified target GeoRaster object with band 0 of the same area of another GeoRaster object.

DECLARE
  gr1 sdo_georaster;
  gr2 sdo_georaster;
  area sdo_number_array := sdo_number_array(-200,-50,201,162);
BEGIN
  SELECT georaster INTO gr2 FROM georaster_table WHERE georid=0 FOR UPDATE;
  SELECT georaster INTO gr1 FROM georaster_table WHERE georid=1;
  SDO_GEOR.updateRaster(gr2, 0, '1', area, gr1, 0, '0', 'true');
  UPDATE GEORASTER_TABLE SET georaster=gr2 WHERE georid=0;
  COMMIT;
END;
/

SDO_GEOR.validateBlockMBR

Format

SDO_GEOR.validateBlockMBR(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Validates the blockMBR attribute of each block of a GeoRaster object.

Parameters

georaster

GeoRaster object.

Usage Notes

This function checks the blockMBR attribute (described in Section 2.2.6) in each row of the raster data table associated with the specified GeoRaster object to see if its geometry is the actual minimum bounding rectangle (MBR) of that block.

This function returns the string TRUE if the blockMBR attribute is the MBR of each block, a null value if the GeoRaster object is null, an Oracle error code if the error is known, or FALSE for an unknown error.

If you created the GeoRaster object as described in Section 3.2, the blockMBR attribute values were automatically calculated and they should not need to be validated or generated. However, if the GeoRaster object was generated by a third party, you should validate the blockMBR attribute values using this function; and if any are not valid, call the SDO_GEOR.generateBlockMBR procedure.

Examples

The following example validates the blockMBR attribute of each block of a specified GeoRaster object.

SELECT sdo_geor.validateBlockMBR(georaster) FROM georaster_table WHERE georid=1;
 
SDO_GEOR.VALIDATEBLOCKMBR(GEORASTER)
--------------------------------------------------------------------------------
TRUE

SDO_GEOR.validateGeoRaster

Format

SDO_GEOR.validateGeoRaster(

     georaster IN SDO_GEORASTER

     ) RETURN VARCHAR2;

Description

Validates a GeoRaster object, checking its raster data and metadata.

Parameters

georaster

GeoRaster object to be checked for validity.

Usage Notes

This function returns the string TRUE if the GeoRaster object is valid, a null value if the GeoRaster object is null, an Oracle error code if the error is known, or FALSE for an unknown error.You should use this function after you create, load, or modify a GeoRaster object, to ensure that it is valid before you process it further.

If this function identifies a GeoRaster object as invalid with an error code of 13454, the object's metadata is not valid according to the GeoRaster XML schema. If this happens, call the SDO_GEOR.schemaValidate function to find specific locations and other information about the errors.

This function not only validates GeoRaster metadata against the GeoRaster XML schema, but it also enforces restrictions and requirements in the current release that are not described in the XML schema. The following are some of the restrictions and requirements enforced by this function:

  • Layer numbers must be from 1 to n where n is the total number of layers.

  • The cellRepresentationType value must be UNDEFINED.

  • If totalBandBlocks or bandBlockSize is specified in the metadata, both must be specified. If there is only one band, no band blocking is allowed.

  • The total number of blocks times the blocking size along a dimension must match the dimension size plus padding size, and the size of each cell data BLOB object must match the metadata description in terms of blocking or nonblocking.

  • The size and number of GeoRaster data blocks stored in the raster data table must be consistent with the metadata description. For cell data, the number and size of the blocks are checked; the content of the blocks is not checked.

  • The only pyramid types supported are NONE (no pyramids) and DECREASE. (For more information about pyramids, see Section 1.7.)

  • The name of the raster data table must not contain spaces, period separators, or mixed-case letters in a quoted string, and all the alphanumeric characters must be uppercase.

  • The raster data table must be an object table of SDO_RASTER type, and the table must exist if the GeoRaster object is not blank.

  • There must be an entry for the GeoRaster object in the ALL_SDO_GEOR_SYSDATA view.

  • Each associated bitmap mask must have the correct number of rows.

  • Any NODATA values and value ranges are in the valid cell value range as designated by the cell depth.

  • For an uncompressed GeoRaster object, the size of the BLOB object in each raster block is checked based on the blocking size and cell depth. However, for a compressed GeoRaster object, the size of the BLOB object in each raster block is not checked. Thus, when a compressed GeoRaster object is decompressed, the data might not be valid with respect to size. (A BLOB with zero length is valid; it is an empty raster block.)

  • For an uncompressed GeoRaster object, the raster block size of each bitmap mask is checked, based on the blocking size and 1BIT cell depth. (A BLOB with zero length is valid; it is an empty bitmap mask raster block.)

  • A generic functional fitting polynomial model is supported, as described in Section 1.6.1. The limitations on offsets, scales, RMS values, pType, nVars, and number of coefficients of the polynomials are described in Section 1.6.1 and Table 2-4 in Section 2.3.5. The SDO_GEOR_SRS data type is a precise map of the GeoRaster SRS polynomial model in the XML metadata document.

  • The SRID in the GeoRaster SRS metadata is not checked against the CS_SRS table and is not validated. To validate the SRID, call SDO_GEOR.getModelSRID and SDO_CS.VALIDATE_WKT (the latter described in Oracle Spatial Developer's Guide). The verticalSRID value is not used in the current release.

  • The RigorousModel and StoredFunction georeferencing models are not supported, although you can store GCP (ground control point) data in an Oracle table and register the table name in the GeoRaster SRS metadata.

  • Spatial resolutions can be inconsistent with the affine transformation scales if the GeoRaster object is georeferenced.

  • GeoRaster temporal referencing and band referencing are not supported, although in the temporal reference system (TRS) and band reference system (BRS) you can store the beginning and ending date and time, the spectral resolution, the spectral unit, and related descriptive information.

  • Only one layerInfo element is supported. A layer can be defined only along one dimension, and this dimension must be BAND. However, within the layerInfo element, the number of subLayer elements is limited only by the total number of layers. The layer number for the objectLayer elements is 0, and the layer numbers for subLayer elements are 1 to n where n is the total number of layers.

  • The scaling function, bin function, and statistical data or histogram can be stored in the GeoRaster metadata and must be valid against the XML schema, but the value ranges for these items are not restricted. GeoRaster interfaces that use this metadata are limited. Applications should validate this optional metadata before using it.

  • The numbers of colormap values and grayscale mapping values are not restricted, but there must be no duplicate colormap or grayscale values, and the values in each array must be consistent with the cellDepth value of the GeoRaster object and must be in ascending order. The value range of the red, green, blue, alpha, and gray components must be integers from 0 to 255.

  • Complex cellDepth values are not supported.

  • This function does not check any external tables (such as a GCP table, bin table, histogram table, grayscale table, or colormap table) whose names are registered in the XML metadata.

  • This function does not validate the spatial extent geometry, or whether or not the spatial relationship between the geometry and the raster data is correct. To validate the spatial extent geometry, use the SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT or SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT procedure, which are documented in Oracle Spatial Developer's Guide.

  • This function does not validate the geometry specified in the blockMBR attribute in raster data tables, or whether or not the geometry precisely encloses the raster blocks. (The blockMBR attribute is described in Section 2.2.6.) To validate the blockMBR geometries, use the SDO_GEOR.validateBlockMBR function.

If there is no entry for the GeoRaster object in the ALL_SDO_GEOR_SYSDATA view (described in Section 2.4), this procedure returns an error stating that the GeoRaster object is not registered. To prevent this error, be sure that the GeoRaster object is inserted into a GeoRaster table and that this table has the required GeoRaster DML trigger created on it. To enable cross-schema access, you must also ensure that users calling this procedure have an appropriate privilege on both the GeoRaster table and the associated raster data table.

Examples

The following example validates the GeoRaster objects in a table.

SELECT t.georid,
       sdo_geor.validategeoraster(t.georaster) isvalid
  from georaster_table t order by georid;

    GEORID ISVALID                                                              
---------- ----------                                                           
         3 TRUE                                                                 
         4 TRUE