12.4 SDO_GEOR_RA.isOverlap

Format

SDO_GEOR.isOverlap(
     georaster1 IN SDO_GEORASTER, 
     georaster2 IN SDO_GEORASTER, 
     tolerance  IN NUMBER DEFAULT 0.5 
     ) RETURN VARCHAR2;

or

SDO_GEOR_RA.isOverlap(
     georArray IN SDO_GEORASTER_ARRAY, 
     tolerance IN NUMBER DEFAULT 0.5 
     ) RETURN VARCHAR2;

or

SDO_GEOR_RA.isOverlap(
     geor_cur  IN SYS_REFCURSOR, 
     tolerance IN NUMBER DEFAULT 0.5 
     ) RETURN VARCHAR2;

Description

Returns the string TRUE if two or more GeoRaster objects overlap, or FALSE if two or more GeoRaster objects do not overlap. (See the Usage Notes for the logic used to determine of two GeoRaster objects, whether georeferenced or not, overlap.)

Parameters

georaster1

GeoRaster object.

georaster2

GeoRaster object.

georArray

An array of GeoRaster objects. The data type is SDO_GEOR_ARRAY, which is defined as VARRAY(10485760) OF SDO_GEORASTER.

geor_cur

Cursor (SYS_REFCURSOR type) for the input GeoRaster objects.

tolerance

Tolerance value used to determine if two cells in the cell space overlap in the model space. The value should be between 0 and 1, and the unit is cell. For example, 0.5 (the default) means one-half cell, namely, that two cells overlap if the distance between them in 0.5 cell or less.

Usage Notes

The GeoRaster objects being compared for overlap must be either all georeferenced or all non-georeferenced.

The following logic is applied to determine if two GeoRaster objects overlap:

  1. If the row or column dimension size of two GeoRaster objects is different, then return 'FALSE'. Otherwise, continue to the next step.

  2. Check if both GeoRaster objects are georeferenced.

    1. If one is georeferenced and the other one is not, then return 'FALSE'.

    2. If both are non-georeferenced, and if the ultCoordinate of both GeoRaster objects is the same, then return 'TRUE'; else, return 'FALSE'.

    3. If both are georeferenced, go to the next step.

  3. Check the pType, nVars, order, and nCoefficients values (explained in Functional Fitting Georeferencing Model) of the p, q, r, and s polynomials. If any are different, then return 'FALSE'; else, go to the next step.

  4. Calculate the upper-left, upper-right, lower-left, and lower-right four points from cell space to model space. If the distance of corresponding points of the two GeoRaster objects is within the tolerance value (converted from cell space to model space), then return 'TRUE'; else, return 'FALSE'.

The raster algebra functions of GeoRaster require the raster layers from different GeoRaster objects have the same size and completely overlap each other. Before you apply raster algebra operations over two or more GeoRaster objects or perform other operations, you can use the SDO_GEOR_RA.isOverlap function to determine if the GeoRaster objects are of the same size and cover the same ground area.

Examples

The following examples check if two GeoRaster objects overlap. (They use two different formats of the function.)

DECLARE 
  geor       SDO_GEORASTER;
  geor1      SDO_GEORASTER;
BEGIN
 
  SELECT georaster INTO geor FROM georaster_table WHERE georid = 1;
  SELECT georaster INTO geor1 FROM georaster_table WHERE georid = 30;
  dbms_output.put_line(sdo_geor_ra.isOverlap(geor,geor1,0.5));
END;
/
 
DECLARE 
  mycursor  sys_refcursor;
BEGIN
  OPEN mycursor FOR
    SELECT georaster FROM georaster_table WHERE georid = 1 or georid=30;
  dbms_output.put_line(sdo_geor_ra.isOverlap(mycursor,0.5));
END;
/