7.150 SDO_GEOR.setSRS
Format
SDO_GEOR.setSRS( georaster IN OUT SDO_GEORASTER, srs IN SDO_GEOR_SRS);
Description
Sets the spatial reference information of a GeoRaster object, or deletes the existing information if you specify a null srs
parameter.
Parameters
- georaster
-
GeoRaster object.
- srs
-
An object of type SDO_GEOR_SRS. The SDO_GEOR_SRS object type and its constructor are described in SDO_GEOR_SRS Object Type.
In this object,
isReferenced
,isRectified
, andisOrthoRectified
must beTRUE
orFALSE
(case-insensitive);spatialResolution
must be an array of the correct size; the spatial tolerance cannot be negative;CoordLocation
must be 0 or 1; and the polynomial parameters cannot be null.
Usage Notes
You can use this procedure to set the GeoRaster SRS for any functional fitting georeferencing models, including the affine transformation, DLT, and RPC models.
For the stored function (GCP) model only, you may find it more convenient not to use this procedure, but instead to use the SDO_GEOR.setGCPGeorefModel procedure to set the stored function (GCP) model.
The GeoRaster object is automatically validated after the operation completes.
To return the SDO_GEOR_SRS information for a GeoRaster object, use the SDO_GEOR.getSRS function.
Examples
The following examples specify spatial reference attributes of a GeoRaster object, and updates the GeoRaster object. (They refer to a table named GEORASTER_TABLE, whose definition is presented after Example 1-1 in Storage Parameters.) Notes explain the operations in more detail.
The first example shows how to set an affine transformation model to a GeoRaster object.
DECLARE grobj sdo_georaster; srs sdo_geor_srs; BEGIN SELECT georaster INTO grobj FROM georaster_table WHERE georid=4; srs := sdo_geor_srs('TRUE', 'TRUE', null, 82262, sdo_number_array(28.5, 28.5),0.5,0, 0,0,0,0,0,1,1,1,1,1,0,0,0, SDO_NUMBER_ARRAY(1, 2, 1, 3, 32631.5614, 0, -.03508772), SDO_NUMBER_ARRAY(1, 0, 0, 1, 1), SDO_NUMBER_ARRAY(1, 2, 1, 3, -7894.7544, .03508772, 0), SDO_NUMBER_ARRAY(1, 0, 0, 1, 1)); sdo_geor.setSRS(grobj, srs); UPDATE georaster_table SET georaster = grobj WHERE georid=4; COMMIT; END; /
In the preceding example, the GeoRaster object has the following affine transformation:
row = 32631.5614 + 0 * x + (-0.03508772) * y col = -7894.7544 + 0.03508772 * x + 0 * y
To use the generic functional fitting georeferencing model described in Functional Fitting Georeferencing Model, the values of SRS attributes are as follows:
xOff=yOff=zOff=0 rowOff=columnOff=0 xScale=yScale=zScale=1 rowScale=columnScale=1 polynomial p : pType=1, nVars=2, order=1, nCoefficients= 3 polynomial q : pType=1, nVars=0, order=0, nCoefficients= 1 polynomial r : pType=1, nVars=2, order=1, nCoefficients= 3 polynomial s : pType=1, nVars=0, order=0, nCoefficients= 1 rowNumerator = 32631.5614, 0, -0.03508772 rowDenominator = 1 columnNumerator = -7894.7544, 0.03508772, 0 columnDenominator = 1
In the SRS structure, the rowNumerator
, rowDenominator
, columnNumerator
, and columnDenominator
elements are used to specify pType
, nVars
, order
, and nCoefficients
, and the remaining elements are used to specify coefficients of each polynomial.
The second example shows how to set a DLT model to a GeoRaster object. In a typical photogrammetry application, the interior orientation parameters and exterior orientation parameters of an oriented digital aerial photo can be used to derive a DLT model, which is widely used to simplify and approximate the rigorous model. The following is an example of a DLT model derived from a standard frame camera model.
row = (-46507111.2127784 + 65.81484127*X + 13.13186856*Y - 49.62133265*Z) / (-41.47013322 + 0.00004128*X + 0.00009740*Y - 0.00655704*Z) col = (-5259855.00453679 - 12.07452653*X + 66.23319061*Y - 49.45792766*Z) / (-41.47013322 + 0.00004128*X + 0.00009740*Y - 0.00655704*Z)
For this example, the corresponding GeoRaster SRS parameters and coefficients are:
rowOff=0, colOff=0; rowScale = colScale = 1; xOff = 0, yOff = 0, zOff = 0; xScale = yScale = zScale =1; polynomial p : pType=1, nVars=3, order=1, nCoefficients= 4 polynomial q : pType=1, nVars=3, order=1, nCoefficients= 4 polynomial r : pType=1, nVars=3, order=1, nCoefficients= 4 polynomial s : pType=1, nVars=3, order=1, nCoefficients= 4 rowNumerator = -5259855.00453679, -12.07452653, 66.23319061, -49.45792766 rowDenominator = -41.47013322, 0.00004128, 0.00009740, -0.00655704 columnNumerator = -46507111.2127784, 65.81484127, 13.13186856, -49.62133265 columnDenominator = -41.47013322, 0.00004128, 0.00009740, -0.00655704
The following sets up the DLT model for the GeoRaster object. It uses the SDO_GEOR_SRS constructor to create an instance of the SDO_GEOR_SRS type, and then sets the appropriate attributes.
DECLARE grobj sdo_georaster; srs sdo_geor_srs; BEGIN SELECT georaster INTO grobj FROM georaster_table WHERE georid = 101; -- Initiate the SRS object. srs:=sdo_geor_srs(); -- Fill the parameters of the SRS object. srs.isReferenced := 'TRUE'; srs.isRectified := 'FALSE'; srs.isOrthoRectified := 'FALSE'; srs.srid := 7406; srs.spatialResolution := sdo_number_array(0.07, 0.07); srs.coordLocation := 1; srs.rowOff := 0; srs.columnOff := 0; srs.xOff := 0; srs.yOff := 0; srs.zOff := 0; srs.rowScale := 1; srs.columnScale := 1; srs.xScale := 1; srs.yScale := 1; srs.zScale := 1; srs.rowNumerator := SDO_NUMBER_ARRAY(1, 3, 1, 4, -5259855.00453679, -12.07452653,66.23319061,-49.45792766); srs.rowDenominator := SDO_NUMBER_ARRAY(1, 3, 1, 4, -41.4701332195, 0.0000412763, 0.0000974018, -0.0065570398); srs.columnNumerator := SDO_NUMBER_ARRAY(1, 3, 1, 4, -46507111.2127784, 65.81484127, 13.13186856, -49.62133265); srs.columnDenominator := SDO_NUMBER_ARRAY(1, 3, 1, 4, -41.4701332195, 0.0000412763, 0.0000974018, -0.0065570398); -- Set the SRS metadata to the GeoRaster object. sdo_geor.setSRS(grobj,srs); UPDATE georaster_table SET georaster = grobj WHERE georid= 101; COMMIT; END; /
Parent topic: SDO_GEOR Package Reference