13.4 SDO_GEOR_UTL.calcSurfaceArea

Format

SDO_GEOR_UTL.calcSurfaceArea(
     georaster IN SDO_GEORASTER, 
     window    IN SDO_GEOMETRY,
     parallel  IN NUMBER
  ) RETURN NUMBER;

Description

Calculates and returns the three–dimensional (3D) surface area represented by digital elevation model (DEM) data that is stored in a GeoRaster object.

Parameters

georaster

GeoRaster object in which DEM data is stored.

window

The 2D geometry object specifying the area of which the 3D surface area is to be calculated.

parallel
Degree of parallelism for the operation. It should be more than 0. The recommended value is 2 times the number of CPUs

Usage Notes

This function first finds out all cells within or touching a certain area specified by the window parameter, splits each of the cells into two 3D triangles, computes the 3D surface area of each triangle, and then returns the sum of these area values as the result. The areas of the triangles that intersect with the window boundary are computed based on the intersected geometries, so this function returns the surface area with a high degree of precision.

If the parallel parameter value is less than 1, then 1 is used (that is, no parallelism).

Examples

The following example calculates the surface area within geom using DEM data. (It refers to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Storage Parameters.)

DECLARE
  geor  SDO_GEORASTER; 
  geom  SDO_GEOMETRY;
  area  number;
BEGIN
  geom:=sdo_geometry(2003,82394, NULL,
                     mdsys.sdo_elem_info_array(1, 1003, 1),
                     mdsys.sdo_ordinate_array(20283.775, 1011087.9,
                                             18783.775, 1008687.9,
                                             21783.775, 1008687.9,
                                             22683.775+0.001, 1009587.9,
                                             20283.775, 1011087.9));
  SELECT georaster INTO geor FROM georaster_table WHERE georid = 3;
  area:=SDO_GEOR_UTL.calcSurfaceArea(geor,geom,2);
END;
/