org.geotools.referencing.operation.builder
Class BursaWolfTransformBuilder

Object
  extended by MathTransformBuilder
      extended by BursaWolfTransformBuilder

public class BursaWolfTransformBuilder
extends MathTransformBuilder

Builds MathTransform setup as BursaWolf transformation from a list of MappedPosition. The calculation uses least square method. Calculated parameters can be used for following operations:

The equations:

 X = q * R * x  +  T ,             
Where X is the Matrix of destination points, q is the scale, R is the rotation Matrix, x is the Matrix of source points and T is matrix of translation. Expressing the errors, we get this:
        Err =  A * Dx + l 
where Err is the Error Matrix, A is Matrix of derivations, Dx is Matrix of difference changes of 7 parameters, and l is value of DX, DY, DZ for calculated from approximate values. Using the least square method to minimalize the errors we get this result:
  Dx = (ATA)-1 ATl  

Since:
2.4
Author:
Jan Jezek
Module:

Field Summary
 
Fields inherited from class MathTransformBuilder
mtFactory
 
Constructor Summary
BursaWolfTransformBuilder(List<MappedPosition> vectors)
          Creates a BursaWolfTransformBuilder.
 
Method Summary
protected  MathTransform computeMathTransform()
          Returns MathtTransform setup as BursaWolf transformation.
protected  GeneralMatrix getA()
          Glues the submatrix of derivations into the A matrix.
 BursaWolfParameters getBursaWolfParameters(GeodeticDatum Datum)
          Returns Bursa Wolf Transformation parameters.
 Class<? extends CartesianCS> getCoordinateSystemType()
          Returns the required coordinate system type, which is cartesian CS.
 int getDimension()
          Returns the dimension for source and target CRS, which is 2.
protected  GeneralMatrix getDq()
          Generates partial derivative in q (scale factor).
protected  GeneralMatrix getDRalfa()
          Generates partial derivative with respect to alfa.
protected  GeneralMatrix getDRbeta()
          Generates partial derivative with respect to beta.
protected  GeneralMatrix getDRgamma()
          Generates partial derivative with respect to gamma.
 GeneralMatrix getDxMatrix()
          Method that claculates the parameters by iteration.
protected  GeneralMatrix getl()
          Calculates the matrix of errors from aproximate values of prameters.
 int getMinimumPointCount()
          Returns the minimum number of points required by this builder, which is 3.
protected  double[] getParameters()
          Returns array of doubles of transformation parameters (dx, dy, dz, ex, ey, ez, scale).
protected  GeneralMatrix getRalfa()
          Generates rotation matrix around X axis.
protected  GeneralMatrix getRbeta()
          Generates rotation matrix around Y axis.
protected  GeneralMatrix getRgamma()
          Generates rotation matrix around Z axis.
protected  GeneralMatrix getx()
          Fills the x matrix by coordinates of source points.
protected  GeneralMatrix getX()
          Fills the x matrix by coordinates of destination points.
 void setTargetGeodeticDatum(GeodeticDatum gd)
           
protected  GeneralMatrix specialMul(GeneralMatrix R, GeneralMatrix x)
          Method for multiplying matrix (3,3) by matrix of coordintes (3 number of coordinates,1)
 
Methods inherited from class MathTransformBuilder
getErrorStatistics, getMappedPositions, getMathTransform, getName, getSourceCRS, getSourcePoints, getTargetCRS, getTargetPoints, getTransformation, printPoints, setMappedPositions, setSourcePoints, setTargetPoints, toString
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BursaWolfTransformBuilder

public BursaWolfTransformBuilder(List<MappedPosition> vectors)
Creates a BursaWolfTransformBuilder.

Parameters:
vectors - list of mapped positions.
Method Detail

getMinimumPointCount

public int getMinimumPointCount()
Returns the minimum number of points required by this builder, which is 3.

Specified by:
getMinimumPointCount in class MathTransformBuilder
Returns:
the minimum number of points required by this builder which is 3.

getDimension

public int getDimension()
Returns the dimension for source and target CRS, which is 2.

Overrides:
getDimension in class MathTransformBuilder
Returns:
dimension for source and target CRS, which is 2.

getCoordinateSystemType

public Class<? extends CartesianCS> getCoordinateSystemType()
Returns the required coordinate system type, which is cartesian CS.

Overrides:
getCoordinateSystemType in class MathTransformBuilder
Returns:
coordinate system type

getx

protected GeneralMatrix getx()
Fills the x matrix by coordinates of source points.

Returns:
x matrix.

getX

protected GeneralMatrix getX()
Fills the x matrix by coordinates of destination points.

Returns:
the X matrix

getRalfa

protected GeneralMatrix getRalfa()
Generates rotation matrix around X axis.

Returns:
rotation Matrix

getRbeta

protected GeneralMatrix getRbeta()
Generates rotation matrix around Y axis.

Returns:
rotation Matrix.

getRgamma

protected GeneralMatrix getRgamma()
Generates rotation matrix around Z axis.

Returns:
rotation Matrix.

getDRalfa

protected GeneralMatrix getDRalfa()
Generates partial derivative with respect to alfa.

Returns:
Matrix, that represents partial derivation of rotation Matrix with respect to alfa.

getDRbeta

protected GeneralMatrix getDRbeta()
Generates partial derivative with respect to beta.

Returns:
Matrix, that represents partial derivation of rotation Matrix with respect to beta.

getDRgamma

protected GeneralMatrix getDRgamma()
Generates partial derivative with respect to gamma.

Returns:
Matrix, that represents partial derivation of rotation Matrix with respect to gamma.

getDq

protected GeneralMatrix getDq()
Generates partial derivative in q (scale factor).

Returns:
rotation Matrix.

getl

protected GeneralMatrix getl()
Calculates the matrix of errors from aproximate values of prameters.

Returns:
the l matrix.

specialMul

protected GeneralMatrix specialMul(GeneralMatrix R,
                                   GeneralMatrix x)
Method for multiplying matrix (3,3) by matrix of coordintes (3 number of coordinates,1)

Parameters:
R - ratrix
x - matrix
Returns:
matrix

getA

protected GeneralMatrix getA()
Glues the submatrix of derivations into the A matrix.

Returns:
A mtarix

getParameters

protected double[] getParameters()
Returns array of doubles of transformation parameters (dx, dy, dz, ex, ey, ez, scale).

Returns:
array of doubles of transformation parameters (dx, dy, dz, ex, ey, ez, scale).

getDxMatrix

public GeneralMatrix getDxMatrix()
Method that claculates the parameters by iteration. The tolarance is set to 1 10-8 and max �number of steps is set to 20.

Returns:
Matrix of parameters (dx, dy, dz, ex, ey, ez, scale).

getBursaWolfParameters

public BursaWolfParameters getBursaWolfParameters(GeodeticDatum Datum)
Returns Bursa Wolf Transformation parameters.

Parameters:
Datum - The target datum for this parameters.
Returns:
parameters the BursaWolfParameters

setTargetGeodeticDatum

public void setTargetGeodeticDatum(GeodeticDatum gd)

computeMathTransform

protected MathTransform computeMathTransform()
                                      throws FactoryException
Returns MathtTransform setup as BursaWolf transformation.

Specified by:
computeMathTransform in class MathTransformBuilder
Returns:
calculated MathTransform
Throws:
FactoryException - when the size of source and destination point is not the same or if the number of points is too small to define such transformation.


Copyright © 1996-2009 Geotools. All Rights Reserved.