6.5 Image Warping

Image warping transforms an input GeoRaster object to an output GeoRaster object using the spatial reference information from a specified SDO_GEOR_SRS object.

The reference SDO_GEOR_SRS object can be copied from an existing GeoRaster object or created using a constructor. (For more information, see SDO_GEOR_SRS Object Type.)

Warping is performed by the SDO_GEOR.warp procedure, and requires that the source GeoRaster object have at least a functional fitting georeferencing model. This means that the image does not need to be rectified, but it needs to have georeference information in the metadata (see Georeferencing GeoRaster Objects).

Example 6-8 Image Warping

The following example uses the SDO_GEOR_SRS information from one GeoRaster image (gr1) as a reference to transform an existing GeoRaster object (gr2) into a new (warped) GeoRaster object (gr3). Thus, the third GeoRaster object is a “copy” (actually, a transformation) of the second GeoRaster object, but reflects the same georeferencing as the first GeoRaster object.

DECLARE
  srs sdo_geor_srs;
  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;

  srs := sdo_geor.getSRS(gr1); -- get the SRS from image 1.

  insert into georaster_table values(3, 'Warped Object',
         sdo_geor.init('imagery_rdt')) 
         returning georaster  into gr3;

  sdo_geor.warp( inGeoRaster      => gr2,
                 pyramidLevel     => null,
                 outSRS           => srs, -- apply SRS to warp transformation
                 cropArea         => null,
                 dimensionSize    => null,
                 layerNumbers     => null,
                 elevationParam   => null,
                 resampleParam    => ‘resampling=AVERAGE4’,
                 storageParam     => ‘pyramid=true’,
                 outGeoRaster     => gr3,
                 bgValues         => sdo_number_array(0,0,0),
                 parallelParam    => ‘parellel=4’ );

  update georaster_table set georaster = gr3 where georid = 3;
  commit;
END;