7.112 SDO_GEOR.reproject

Format

SDO_GEOR.reproject(
     inGeoRaster     IN SDO_GEORASTER, 
     resampleParam   IN VARCHAR2 DEFAULT NULL, 
     storageParam    IN VARCHAR2 DEFAULT NULL, 
     outSRID         IN NUMBER, 
     outGeoraster    IN OUT SDO_GEORASTER, 
     bgValues        IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.reproject(
     inGeoRaster     IN SDO_GEORASTER, 
     pyramidLevel    IN NUMBER DEFAULT 0, 
     cropArea        IN SDO_GEOMETRY DEFAULT NULL, 
     layerNumbers    IN VARCHAR2, 
     resampleParam   IN VARCHAR2 DEFAULT NULL, 
     storageParam    IN VARCHAR2 DEFAULT NULL, 
     outSRID         IN NUMBER, 
     outGeoraster    IN OUT SDO_GEORASTER, 
     bgValues        IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.reproject(
     inGeoRaster     IN SDO_GEORASTER, 
     pyramidLevel    IN NUMBER DEFAULT 0, 
     cropArea        IN SDO_NUMBER_ARRAY DEFAULT NULL, 
     bandNumbers     IN VARCHAR2, 
     resampleParam   IN VARCHAR2 DEFAULT NULL, 
     storageParam    IN VARCHAR2 DEFAULT NULL, 
     outSRID         IN NUMBER, 
     outGeoraster    IN OUT SDO_GEORASTER, 
     bgValues        IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.reproject(
     inGeoRaster     IN SDO_GEORASTER, 
     pyramidLevel    IN NUMBER DEFAULT 0, 
     cropArea        IN SDO_GEOMETRY DEFAULT NULL, 
     layerNumbers    IN VARCHAR2, 
     resampleParam   IN VARCHAR2 DEFAULT NULL, 
     storageParam    IN VARCHAR2 DEFAULT NULL, 
     outSRID         IN NUMBER, 
     rasterBlob      IN OUT NOCOPY BLOB, 
     outArea         OUT SDO_GEOMETRY, 
     outWindow       OUT SDO_NUMBER_ARRAY, 
     bgValues        IN SDO_NUMBER_ARRAY DEFAULT NULL);

or

SDO_GEOR.reproject(
     inGeoRaster     IN SDO_GEORASTER, 
     pyramidLevel    IN NUMBER DEFAULT 0, 
     cropArea        IN SDO_NUMBER_ARRAY DEFAULT NULL, 
     bandNumbers     IN VARCHAR2, 
     resampleParam   IN VARCHAR2 DEFAULT NULL, 
     storageParam    IN VARCHAR2 DEFAULT NULL, 
     outSRID         IN NUMBER, 
     rasterBlob      IN OUT NOCOPY BLOB, 
     outArea         OUT SDO_GEOMETRY, 
     outWindow       OUT SDO_NUMBER_ARRAY, 
     bgValues        IN SDO_NUMBER_ARRAY DEFAULT NULL);

Description

Reprojects all or part of a GeoRaster object to a different Oracle Spatial coordinate system (specified by the outSRID parameter). The resulting object can be a new GeoRaster object (for persistent storage) or a BLOB (for temporary use).

Parameters

inGeoRaster

The SDO_GEORASTER object on which the reprojection operation is to be performed to create the new object.

pyramidLevel

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

cropArea

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

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

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

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

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

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 Blank and Empty GeoRaster Objects.) Cannot be the same GeoRaster object as inGeoRaster.

rasterBlob

BLOB to hold the output reflecting the new coordinate system. It must exist or have been initialized before the reprojection operation.

outArea

An SDO_GEOMETRY object containing the MBR (minimum bounding rectangle) in the model coordinate system of the resulting object.

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.

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 Empty Raster Blocks). The number of elements in the SDO_NUMBER_ARRAY object must be either one (same filling 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 default bgValues are zero (0).

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 two general kinds of interfaces:

  • The first three formats generate a persistent GeoRaster object for storage in the database.

  • The remaining formats generate a BLOB for temporary storage for immediate use, such as to display data on the screen.

inGeoRaster should be georeferenced and have a SRID value from the SRID column of the MDSYS.CS_SRS table. outSRID should be different from the SRID of inGeoRaster. In some cases, the reprojection is inappropriate, such as reprojecting a GeoRaster object in NAD83, Massachusetts Mainland (SRID = 26986) to coordinate system NAD 27, UTM zone 49N (SRID = 2032649). In this case, the reprojection would result in a large distortion and thus is not performed.

inGeoRaster and outGeoRaster must be different GeoRaster objects. After the operation, the ULT coordinates of the resulting GeoRaster object are set to zero (0).

If the source or destination object has a three-dimensional coordinate system, the height (Z) values are set to zero (0).

If you use the format that includes the pyramidLevel parameter and you specify a value greater than zero (0), the reprojection is based on the specified pyramid level of the source GeoRaster object; otherwise, the reprojection is based on the original GeoRaster object (pyramidLevel=0). The output GeoRaster object has no pyramid data.

If the cropArea parameter data type is SDO_GEOMETRY, its SDO_SRID value must be a value from the SRID column of the MDSYS.CS_SRS table. If the SDO_SRID values for the cropArea parameter geometry and the inGeoraster object model space are different, the cropArea parameter geometry is automatically transformed to the coordinate system of the model space before the operation is performed. (Raster space and model space are explained in GeoRaster Data Model.)

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.) Only the overlapping portion of the specified crop area and the spatial extent of the source GeoRaster object is reprojected.

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, BILINEAR, CUBIC, AVERAGE4, AVERAGE16. For more information, see Resampling and Interpolation.

  • 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, CUBIC, AVERAGE4, or AVERAGE16, 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.

Examples

The following example reprojects a GeoRaster object into the coordinate system defined by SRID 32618. The result is another GeoRaster object.

DECLARE
   gr1 sdo_georaster;
   gr2 sdo_georaster;
BEGIN
  SELECT georaster INTO gr1 from georaster_table WHERE georid=10;
  INSERT INTO reproject_table VALUES (21, 'WGS 84 / UTM zone 18N',
                                      SDO_GEOR.init('rdt_5', 21))
  RETURNING georaster INTO gr2;
  sdo_geor.Reproject(gr1, 0, 0, SDO_NUMBER_ARRAY(0, 0, 517, 517),
                             null, null, 'blocking=optimalpadding, blocksize=(512,512,3),
                             interleaving=BSQ', 32618, gr2);
   UPDATE georaster_table SET georaster=gr2 WHERE georid=21;
   COMMIT;
END;
/

The following example reprojects a GeoRaster object into the coordinate system defined by SRID 32618. The result is temporary BLOB containing data in JPEG-F format.

DECLARE
   gr1 sdo_georaster;
   lob1 BLOB;
   outArea SDO_Geometry;
   outWindow SDO_NUMBER_ARRAY;
BEGIN
   SELECT georaster INTO gr1 from georaster_table WHERE georid=10;
   dbms_lob.createTemporary(lob1, TRUE);
   sdo_geor.Reproject(gr1, 0, SDO_NUMBER_ARRAY(0, 0, 120, 300),
                              '0',  null, 'compression = JPEG-F', 32618,
                              lob1, outArea, outWindow);
 
   dbms_lob.freeTemporary(lob1);
   COMMIT;
END;
/