Class BursaWolfTransformBuilder
Object
MathTransformBuilder
BursaWolfTransformBuilder
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 + lwhere 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
-
Field Summary
Fields inherited from class MathTransformBuilder
mtFactory
-
Constructor Summary
ConstructorsConstructorDescriptionBursaWolfTransformBuilder
(List<MappedPosition> vectors) Creates a BursaWolfTransformBuilder. -
Method Summary
Modifier and TypeMethodDescriptionprotected MathTransform
Returns MathtTransform setup as BursaWolf transformation.protected GeneralMatrix
getA()
Glues the submatrix of derivations into the A matrix.Returns Bursa Wolf Transformation parameters.Class<? extends CartesianCS>
Returns the required coordinate system type, which is cartesian CS.int
protected GeneralMatrix
getDq()
Generates partial derivative in q (scale factor).protected GeneralMatrix
Generates partial derivative with respect to alfa.protected GeneralMatrix
Generates partial derivative with respect to beta.protected GeneralMatrix
Generates partial derivative with respect to gamma.Method that claculates the parameters by iteration.protected GeneralMatrix
getl()
Calculates the matrix of errors from aproximate values of prameters.int
Returns the minimum number of points required by this builder, which is 3.protected double[]
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
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
protected GeneralMatrix
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
-
Constructor Details
-
BursaWolfTransformBuilder
Creates a BursaWolfTransformBuilder.- Parameters:
vectors
- list of mapped positions.
-
-
Method Details
-
getMinimumPointCount
public int getMinimumPointCount()Returns the minimum number of points required by this builder, which is 3.- Specified by:
getMinimumPointCount
in classMathTransformBuilder
- Returns:
- the minimum number of points required by this builder which is 3.
-
getDimension
public int getDimension()- Overrides:
getDimension
in classMathTransformBuilder
- Returns:
- dimension for source and
target
CRS, which is 2.
-
getCoordinateSystemType
Returns the required coordinate system type, which is cartesian CS.- Overrides:
getCoordinateSystemType
in classMathTransformBuilder
- Returns:
- coordinate system type
-
getx
Fills the x matrix by coordinates of source points.- Returns:
- x matrix.
-
getX
Fills the x matrix by coordinates of destination points.- Returns:
- the X matrix
-
getRalfa
Generates rotation matrix around X axis.- Returns:
- rotation Matrix
-
getRbeta
Generates rotation matrix around Y axis.- Returns:
- rotation Matrix.
-
getRgamma
Generates rotation matrix around Z axis.- Returns:
- rotation Matrix.
-
getDRalfa
Generates partial derivative with respect to alfa.- Returns:
- Matrix, that represents partial derivation of rotation Matrix with respect to alfa.
-
getDRbeta
Generates partial derivative with respect to beta.- Returns:
- Matrix, that represents partial derivation of rotation Matrix with respect to beta.
-
getDRgamma
Generates partial derivative with respect to gamma.- Returns:
- Matrix, that represents partial derivation of rotation Matrix with respect to gamma.
-
getDq
Generates partial derivative in q (scale factor).- Returns:
- rotation Matrix.
-
getl
Calculates the matrix of errors from aproximate values of prameters.- Returns:
- the l matrix.
-
specialMul
Method for multiplying matrix (3,3) by matrix of coordintes (3 number of coordinates,1)- Parameters:
R
- ratrixx
- matrix- Returns:
- matrix
-
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
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
Returns Bursa Wolf Transformation parameters.- Parameters:
Datum
- The target datum for this parameters.- Returns:
- parameters the BursaWolfParameters
-
setTargetGeodeticDatum
-
computeMathTransform
Returns MathtTransform setup as BursaWolf transformation.- Specified by:
computeMathTransform
in classMathTransformBuilder
- 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.
-