7.103 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 GeoRaster System Data Views (xxx_SDO_GEOR_SYSDATA). GeoRaster operations are described in GeoRaster Database Creation and Management and GeoRaster Data Query and Manipulation.)

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

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