7.23 SDO_GEOR.generateSpatialExtent

Format

SDO_GEOR.generateSpatialExtent(
     georaster  IN SDO_GEORASTER, 
     height     IN NUMBER DEFAULT NULL 
     ) RETURN SDO_GEOMETRY;

Description

Generates a spatial geometry that contains the spatial extent (footprint) of the GeoRaster object.

Parameters

georaster

GeoRaster object.

height

Number specifying the Z value for three-dimensional (X, Y, Z) georeferencing.

Usage Notes

The returned SDO_GEOMETRY object is based on the model coordinate system of the GeoRaster object. If the GeoRaster object is not georeferenced, the SDO_GEOMETRY object has a null SDO_SRID value, which means the footprint geometry is in cell space; otherwise, the SDO_SRID value of the SDO_GEOMETRY object is the model SRID. Specifically:

  • If the GeoRaster object is not georeferenced or if the model coordinate system is projected, the spatial extent object is a single polygon derived from eight boundary points.

  • If the model coordinate system is geodetic, the spatial extent is densified according to the object's spatial footprint. If the area of the footprint is not larger than half of the Earth's surface, the result is a single geodetic polygon. Otherwise, a geodetic MBR is returned as the generated spatial extent object, and this returned object will be an invalid geometry according to Oracle Spatial validation rules, but index and query operations will work on this returned object.

The footprint is automatically adjusted, based on the GeoRaster object's model coordinate location (CENTER or UPPERLEFT), to cover the whole area in the model space. CENTER is the default model coordinate location for non-georeferenced cases.

If the model coordinate system is three-dimensional, the generated spatial extent is a three-dimensional geometry. To build a spatial index based on the generated value, you may need to convert it into a two-dimensional geometry before saving it in the spatialExtent attribute of the GeoRaster object. For more information about cross-dimensionality transformations, see Oracle Spatial Developer's Guide.

This function does not set the spatial extent of the GeoRaster object (spatialExtent attribute, described in spatialExtent Attribute). For information about setting the spatial extent, see Generating and Setting Spatial Extents.

If georaster is null, this function returns a null SDO_GEOMETRY object. If georaster is not valid, an exception is raised.

Examples

The following example generates a three-dimensional spatial extent, with a Z or height dimension value of 10, in the geographic 3D coordinate system 4327 (the model SRID). (The output is slightly reformatted.)

SELECT SDO_GEOR.generateSpatialExtent(georaster,10) spatialExtent
  FROM georaster_table where georid=10;
 
SPATIALEXTENT(A.GEORASTER,10)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_IN
----------------------------------------------------------------------------------
SDO_GEOMETRY(3003, 4327, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(.181818182, 1.1627907, 10, 12.1228111, 1.07010227, 10, 19.3902574, 1.07010229, 10, 25.1482989, 1.07010229, 10, 30.0714774, 1.07010229,
10, 34.4500035, 1.07010229, 10, 38.3920079, 1.07010229, 10, 42.0490801,
1.07010229, 10, 45.4612165, 1.07010229, 10, 48.6719786, 1.07010229, 10,
53.6193472, 1.07010229, 10, 53.6193472, 12.346373, 10, 53.6178888, 15.3903048,
10, 53.6178888, 18.3032341, 10, 50.6322061, 18.3032341, 10, 47.5331761,
18.3032341, 10, 44.2541078, 18.3032341, 10, 40.7594212, 18.3032341, 10, 37,
18.3032341, 10, 32.9046537, 18.3032341, 10, 28.3630834, 18.3032341, 10,
23.1869539, 18.3032341, 10, 17, 18.3032341, 10, -2.220E-16, 18.3032341, 10, 0,
16.3247208, 10, -2.220E-16, 13.6133114, 10, .181818182, 1.1627907, 10))

The following examples return the spatial extent geometry of GeoRaster objects in the GEORASTER column of the GEORASTER_TABLE table. (They refer to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Storage Parameters.)

SELECT sdo_geor.generateSpatialExtent(georaster) spatialExtent
  FROM georaster_table WHERE georid=2;
 
SPATIALEXTENT(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINA
--------------------------------------------------------------------------------
 
SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARR
AY(0, 0, 256, 0, 511, 0, 511, 256, 511, 511, 256, 511, 0, 511, 0, 256, 0, 0))
 
SET NUMWIDTH 20
SELECT sdo_geor.generateSpatialExtent(georaster) spatialExtent
  FROM georaster_table WHERE georid=4;
 
SPATIALEXTENT(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO,
SDO_ORDINA
--------------------------------------------------------------------------------
 
SDO_GEOMETRY(2003, 82263, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_AR
RAY(1828466.0909315, 646447.1932945, 1828466.0909315, 644479.85524, 1828466.0909
315, 642512.5171855, 1830433.428986, 642512.5171855, 1832400.7670405, 642512.517
1855, 1832400.7670405, 644479.85524, 1832400.7670405, 646447.1932945, 1830433.42
8986, 646447.1932945, 1828466.0909315, 646447.1932945))