1.6 Georeferencing

The GeoRaster spatial reference system (SRS), a metadata component of the GeoRaster object, includes information related to georeferencing. Georeferencing establishes the relationship between cell coordinates of GeoRaster data and real-world ground coordinates (or some local coordinates). Georeferencing assigns ground coordinates to cell coordinates, and cell coordinates to ground coordinates.

In GeoRaster, georeferencing is different from geocorrection, rectification, or orthorectification. In these three latter processes, cell resampling is often performed on the raster data, and the resulting GeoRaster data might have a different model coordinate system and dimension sizes. Georeferencing establishes the relationship between cell coordinates and real-world coordinates or some local coordinates. Georeferencing can be accomplished by providing an appropriate mathematical formula, enough ground control point (GCP) coordinates, or rigorous model data from the remote sensing system. Georeferencing does not change the GeoRaster cell data or other metadata, except as needed to facilitate the transformation of coordinates between the cell coordinate system and the model coordinate system.

GeoRaster supports both the functional fitting model (explained in Functional Fitting Georeferencing Model) and the stored function model (explained in Ground Control Point (GCP) Georeferencing Model) for georeferencing. Rigorous models are not supported. When a GeoRaster object is georeferenced with the functional fitting model, the isReferenced value in the SRS metadata will be TRUE; otherwise, it should be FALSE.

Rectification can be done with horizontal coordinates, so that cells of a GeoRaster data set can be mapped to a projection map coordinate system. After rectification, each cell is regularly sized in the map units and is aligned with the model coordinate system, that is, with the East-West dimension and the North-South dimension. If elevation data (DEM) is used in rectification, it is called orthorectification, a special form of rectification that corrects terrain displacement. If a GeoRaster object is rectified and georeferenced with the functional fitting model, the isRectified value in its metadata will be TRUE; otherwise, it should be FALSE. If a GeoRaster object is orthorectified and georeferenced with the functional fitting model, the isOrthoRectified value in its metadata will be TRUE; otherwise, it should be FALSE.

To georeference a GeoRaster object, see Georeferencing GeoRaster Objects and Advanced Georeferencing. To rectify and orthorectify a GeoRaster object, see Image Rectification and Image Orthorectification.

1.6.1 Functional Fitting Georeferencing Model

GeoRaster defines a generic functional fitting georeferencing model that is stored in the GeoRaster metadata. It includes several widely used geometric models, and it enables many non-rectified GeoRaster objects to be georeferenced.

This model supports transformations between two-dimensional or three-dimensional ground coordinates and two-dimensional cell coordinates, or between two-dimensional cell coordinates and two-dimensional or three-dimensional ground coordinates. The following equations describe the model:

rn = p(Xn,Yn,Zn) / q(Xn,Yn,Zn)

cn = r(Xn,Yn,Zn) / s(Xn,Yn,Zn)

In these equations:

  • rn = Normalized row index of the cell in the raster

  • cn = Normalized column index of the cell in the raster

  • Xn , Yn , Zn = Normalized ground coordinate values

The polynomials p(Xn , Yn , Zn), q(Xn , Yn , Zn), r(Xn , Yn , Zn), and s(Xn , Yn , Zn) have the form shown in Figure 1-6:

Figure 1-6 Polynomials Used for Georeferencing

Description of Figure 1-6 follows
Description of "Figure 1-6 Polynomials Used for Georeferencing"

In the polynomial form shown in Figure 1-6, aijk are the coefficients for the polynomial.

Each of the four polynomials can be different, and each polynomial is described independently by the following:

  • pType = Polynomial type (1 or 2)

  • nVars = Total number of variables (ground coordinate dimensions; 0, 2, or 3)

  • order = Maximum order of power for each variable or maximum total order of power for each polynomial term (up to 5)

  • nCoefficients = Total number of coefficients (must be derived from the preceding three numbers)

The pType indicates the meaning of the maximum total order of the polynomial, and thus affects the total number of terms in the polynomial. pType = 1 indicates that the maximum order is the maximum total order of all variables in each polynomial term. pType = 2 indicates that the maximum order is the maximum order of each variable in all polynomial term. The nVars indicates whether or not the ground coordinate system is 2D (X, Y) or 3D (X,Y,Z). The cell coordinate systems are always 2D. For example, it supports 2D-to-2D affine transformation and 3D-to-2D DLT and RPC models.

The total number and sequential ordering of the polynomial terms and their coefficients are determined by the logic in the following looping pseudocode:

         n = 0;
         For (k = 0; k <= order; k++)
            For (j = 0; j <= order; j++)
               For (i = 0; i <= order; i++)
                 {
                       if (pType == 1 & (i+j+k) > order )
                            break;
                        polynomialCoefficients[n]=COEF[ijk];
                        n++;
                  }

In the preceding pseudocode, assume i is the order of X, j is the order of Y and k is the order of Z, and n is the index of the coefficients inside the GeoRaster metadata element <polynomialCoefficients>. Thus, COEF[ijk] is the coefficient of the term x(i)y(j)z(k) of numerator p or denominator q; polynomialCoefficients[n] is the nth double number of the <polynomialCoefficients> element (a list type of doubles) inside the XML metadata; and COEF[ijk] and polynomialCoefficients[n] have a one-to-one match.

Normalized values, rather than actual values, may or may not be stored and used in order to minimize introduction of errors during the calculations, depending on the data itself. The transformation between row and column values (row,column) and normalized row and column values (rn, cn), and between the model coordinate (x,y,z) and normalized model coordinate (Xn , Yn , Zn), is defined by a set of normalizing translations (offsets) and scales:

  • rn = (row - rowOff) / rowScale

  • cn = (column - columnOff) / columnScale

  • Xn = (x - xOff) / xScale

  • Yn = (y - yOff) / yScale

  • Zn = (z - zOff) / zScale

The coefficients, scales, and offsets are stored in the GeoRaster SRS metadata, and are described in SDO_GEOR_SRS Object Type.

This functional fitting model is generic. It includes specific geometric models, such as Affine Transformation, Quadratic Polynomial, Cubic Polynomial, Direct Linear Transformation (DLT), Quadratic Rational, and Rational Polynomial Coefficients (RPC, also called Rapid Positioning Coefficients). The coefficients of those standard models are converted to the sequential ordering described in this section, for storage in GeoRaster.

You can use the SDO_GEOR.setSRS procedure to directly set the spatial reference information of a GeoRaster object, and the SDO_GEOR.getGeoreferenceType function to find out the specific georeferencing model type in a GeoRaster object.

The simplest georeferencing model type is a special affine transformation, as follows:

row    = a + c * y
column = d - c * x

In the preceding formulas, if c is not zero, the raster data is considered rectified, and the isRectified value in its metadata will be TRUE.

For the Affine Transformation, pType can be either 1 or 2. nVars is 2, order is 1, and nCoefficients is 3 for the p and r polynomials; and nVars is 0, order is 0, and nCoefficients is 1 for the q and s polynomials.

For the Quadratic Polynomial model, pType is 1. nVars is 2, order is 2, and nCoefficients is 6 for the p and r polynomials; and nVars is 0, order is 0, and nCoefficients is 1 for the q and s polynomials.

For the Cubic Polynomial model, pType is 1. nVars is 2, order is 3, and nCoefficients is 10 for the p and r polynomials; and nVars is 0, order is 0, and nCoefficients is 1 for the q and s polynomials.

For the DLT model, pType can be either 1 or 2. nVars is 3, order is 1, and nCoefficients is 4 for all polynomials. In addition, the q and s polynomials must be identical.

For the Quadratic Rational model, pType is 1. nVars is 3, order is 2, and nCoefficients is 10 for all polynomials.

For the RPC model, pType is 1. nVars is 3, order is 3, and nCoefficients is 20 for all polynomials.

For detailed information about the DLT, RPC, and other geometric models, see any relevant third-party documentation.

1.6.2 Ground Control Point (GCP) Georeferencing Model

GeoRaster supports ground control point (GCP) storage and georeferencing. A ground control point (GCP), or simply a control point, is a point for which you know its coordinates (X,Y or X,Y,Z) in some reference coordinate system, as well as its corresponding location (row, column) in cell space in the GeoRaster object. The reference coordinate system can be any valid Oracle Spatial coordinate system, including SRID 999999 for an "unknown" coordinate system. A collection of GCPs and its associated geometric model (functional fitting method) are also referred to as (called) the stored function georeferencing model in GeoRaster.

You can use GCPs that are either stored in the GeoRaster SRS or specified in parameters to generate the Functional Fitting model. For more information, see the SDO_GEOR.georeference function.

The guidelines for selecting GCPs include the following:

  • The points should be easy to identify both in the GeoRaster object and in the reference coordinate system.

  • The points should be evenly distributed within the area covered by the GeoRaster object, to ensure that results are not skewed.

  • The points should not be on a line, so that the results can be stable.

GCPs or the stored function are specified using the SDO_GEOR_GCP object type (see SDO_GEOR_GCP Object Type), the SDO_GEOR_GCP_ COLLECTION collection type (see SDO_GEOR_GCP_ COLLECTION Collection Type), and the SDO_GEOR_GCPGEOREFTYPE object type (see SDO_GEOR_GCPGEOREFTYPE Object Type).

To georeference using GCPs, you must also select the geometric model, that is, how the relationship between the GeoRaster object's cell space and the reference coordinate system should be mathematically modeled. In GeoRaster, the following geometric models are supported with GCP georeferencing: Affine (the default model), Quadratic Polynomial, Cubic Polynomial, DLT, Quadratic Rational, and RPC. Affine, Quadratic Polynomial, and Cubic Polynomial are two-dimensional polynomial models with polynomial order 1, 2, and 3, respectively; DLT, Quadratic Rational, and RPC are three-dimensional rational polynomial models with polynomial order 1, 2, and 3, respectively. All the polynomials have polynomial type pType=1. (See Functional Fitting Georeferencing Model for more information about the georeferencing model types.)

In georeferencing using GCPs, the cell and model coordinates of the GCPs are used in the formula of the polynomial or rational polynomial model, and then a linear equation system is formed. No weight is used in the formula, that is, all points have equal weight 1.0. The linear equation system is solved by the least square method, which generates the coefficients for the model that best fits the given control points. Only GCPs with type Control Point are involved in the solution calculation; the GCP with type Check Point is used to check the positioning accuracy of the solved model. The solution accuracy is evaluated based on the residuals of the cell coordinates of those control points involved in the solution.

Different geometric models require different model coordinate dimensions and a different minimum number of GCPs. For two-dimensional geometric models, the model coordinates must be 2D (X,Y); and for three-dimensional geometric models, the model coordinates must be 3D (X, Y, Z). The minimum number of GCPs required for the geometric models are as follows: Affine: 3, Quadratic Polynomial: 6, Cubic Polynomial: 10, DLT: 7, Quadratic Rational: 19, and RPC: 39. However, you should generally use more than the minimum number of GCPs to do georeferencing.

For more information, see Advanced Georeferencing.

1.6.3 Cell Coordinate and Model Coordinate Transformation

Through the functional fitting georeferencing model, GeoRaster assigns ground coordinates to cell coordinates, and cell coordinates to ground coordinates. As a special case, a cell's integer coordinate (the array index of a cell in the cell matrix) can be transformed into a model coordinate, which identifies an exact location of a point in the model space. This point or model coordinate may be either the upper-left corner or the center of the area represented by the cell in the model space.

Similarly, a model coordinate can be transformed into a cell coordinate through georeferencing. However, the resulting cell coordinate from the direct solution of the functional fitting georeferencing model is mostly in floating numbers. The type of the cell space coordinate system, which is decided by the modelCoordinateLocation element, determines which cell the floating coordinate refers to, as described in GeoRaster Data Model. GeoRaster supports both floating (subcell) cell coordinates and integer cell coordinates in all parts of its API.

Cell coordinate and model coordinate transformations are based on the functional fitting model of the GeoRaster spatial reference system (SRS). Both before and after transformation using the GeoRaster SRS, the (row, column) coordinate values of a cell are relative to the GeoRaster cell space, not necessarily relative to the upper-left corner of the raster data itself. The ULTCoordinate can have a different coordinate (row and column values) from the coordinate of the origin of the cell space. That is, the (row, column) coordinate of the upper-left corner is not necessarily (0,0).

Any application that defines the upper-left corner of a raster data as the origin (0, 0) of its own cell space, as in many image file formats, must convert the (row, column) derived from the GeoRaster SRS to be relative to that origin, if the value of GeoRaster ULTCoordinate (row0, column0) is not (0, 0). This conversion must take the GeoRaster ULTCoordinate into consideration, as shown in the following formulas:

row = row0 + m
column = column0 + n

In these formulas:

  • row = Row index of the cell relative to the origin of the GeoRaster cell space.

  • column = Column index of the cell relative to the origin of the GeoRaster cell space.

  • row0 = Row index of the ULTCoordinate relative to the origin of the GeoRaster cell space.

  • column0 = Column index of the ULTCoordinate relative to the origin of the GeoRaster cell space.

  • m = Row index (that is, the mth row, starting at 0 for the first row) of the cell relative to the ULTCoordinate.

  • n = Column index (that is, the nth column, starting at 0 for the first column) of the cell relative to the ULTCoordinate.

In most applications, the ULTCoordinate and the origin of cell space are the same (that is, row0 = 0 and column0 = 0), in which case m = row and n = column.