Class InterpolatedGeocentricTransform
Object
FormattableObject
AbstractMathTransform
DatumShiftTransform
InterpolatedGeocentricTransform
- All Implemented Interfaces:
Serializable, Parameterized, LenientComparable, Printable, MathTransform
Transforms between two geographic CRS by performing geocentric translations interpolated from a grid file.
This transform is used mainly for
France geocentric interpolation(ESPG:9655) datum shifts, but Apache SIS implementation allows the use for other regions.
Algorithm
This class transforms two- or three- dimensional coordinates from a geographic CRS to another geographic CRS. The changes between source and target coordinates are small (usually less than 400 metres), but vary for every position. Those changes are provided in a datum shift grid, usually loaded from one or two files.Many datum shift grids like NADCON and NTv2 apply the changes directly on geographic coordinates.
This relatively simple case is handled by InterpolatedTransform.
But the InterpolatedGeocentricTransform algorithm uses the grid in a more complex way:
- Convert input geographic coordinate (λ,φ) to geocentric coordinate (X,Y,Z).
- Ask
DatumShiftGridfor the offset to apply for coordinate (λ,φ). But instead of returning a (Δλ, Δφ) offset, the grid shall return a (ΔX, ΔY, ΔZ) offset. - Convert the shifted geocentric coordinate (X+ΔX, Y+ΔY, Z+ΔZ) back to a geographic coordinate.
Reference
IGN documentNTG_88.pdf,
Grille de paramètres de transformation de coordonnéesat http://www.ign.fr. Note however that the signs of (ΔX, ΔY, ΔZ) values expected by this class are the opposite of the signs used in NTG_88 document. This is because NTG_88 grid defines shifts from target to source, while this class expects shifts from source to target.
Note: this algorithm is not the same as a (theoretical) EllipsoidToCentricTransform →
InterpolatedTransform → (inverse of EllipsoidToCentricTransform) concatenation
because the DatumShiftGrid inputs are geographic coordinates even if the interpolated
grid values are in geocentric space.
- Since:
- 0.7
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInterpolatedGeocentricTransform(Ellipsoid source, boolean isSource3D, Ellipsoid target, boolean isTarget3D, DatumShiftGrid<Angle, Length> grid) Creates a transform from the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic MathTransformcreateGeodeticTransformation(MathTransformFactory factory, Ellipsoid source, boolean isSource3D, Ellipsoid target, boolean isTarget3D, DatumShiftGrid<Angle, Length> grid) Creates a transformation between two geographic CRS.intGets the dimension of input points.intGets the dimension of output points.inverse()Returns the inverse of this interpolated geocentric transform.transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) Transforms the (λ,φ) or (λ,φ,h) coordinates between two geographic CRS, and optionally returns the derivative at that location.Methods inherited from class DatumShiftTransform
getContextualParameters, getParameterValuesModifier and TypeMethodDescriptionprotected ContextualParametersReturns the parameters used for creating the complete transformation.Returns the internal parameter values of thisDatumShiftTransforminstance (ignoring context).Methods inherited from class AbstractMathTransform
derivative, equals, formatTo, getDomain, getParameterDescriptors, getStandardType, hashCode, isIdentity, transform, transform, transform, transform, transform, tryConcatenateModifier and TypeMethodDescriptionderivative(DirectPosition point) Gets the derivative of this transform at a point.final booleanCompares the specified object with this math transform for strict equality.protected StringFormats the inner part of a Well Known Text version 1 (WKT 1) element.getDomain(DomainDefinition criteria) Returns the ranges of coordinate values which can be used as inputs.Returns the parameter descriptors for this math transform, ornullif unknown.final TypeReturns the class that defines the public properties of this instance.final intReturns a hash value for this transform.booleanTests whether this transform does not move any points.voidtransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms a list of coordinate tuples.voidtransform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms a list of coordinate tuples.voidtransform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms a list of coordinate tuples.voidtransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms a list of coordinate tuples.transform(DirectPosition ptSrc, DirectPosition ptDst) Transforms the specifiedptSrcand stores the result inptDst.protected voidtryConcatenate(TransformJoiner context) Concatenates in an optimized way this math transform with its neighbor, if possible.Methods inherited from class FormattableObject
print, toString, toString, toWKTModifier and TypeMethodDescriptionvoidprint()Prints a string representation of this object to the standard output stream.Returns a Well Known Text (WKT) or an alternative text representation for this object.toString(Convention convention) Returns a Well Known Text (WKT) for this object using the specified convention.toWKT()Returns a strictly compliant Well Known Text (WKT) using the default convention, symbols and indentation.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface MathTransform
toWKT
-
Constructor Details
-
InterpolatedGeocentricTransform
protected InterpolatedGeocentricTransform(Ellipsoid source, boolean isSource3D, Ellipsoid target, boolean isTarget3D, DatumShiftGrid<Angle, Length> grid) Creates a transform from the specified parameters. ThisInterpolatedGeocentricTransformclass expects coordinate values in the following order and units:- longitudes in radians relative to the prime meridian (usually Greenwich),
- latitudes in radians,
- optionally heights above the ellipsoid, in same units as the source ellipsoid axes.
InterpolatedGeocentricTransforminstances need to be concatenated with the following affine transforms:- Normalization before
InterpolatedGeocentricTransform:- Conversion of (λ,φ) from degrees to radians.
- Denormalization after
InterpolatedGeocentricTransform:- Conversion of (λ,φ) from radians to degrees.
InterpolatedGeocentricTransformconstruction, the full conversion chain including the above affine transforms can be created byDatumShiftTransform.getContextualParameters().completeTransform(factory, this)}.- Parameters:
source- the source ellipsoid.isSource3D-trueif the source coordinates have a height.target- the target ellipsoid.isTarget3D-trueif the target coordinates have a height.grid- the grid of datum shifts from source to target datum. TheDatumShiftGrid.interpolateInCell(…)method shall compute (ΔX, ΔY, ΔZ) translations from source to target in the unit of source ellipsoid axes.- See Also:
-
-
Method Details
-
createGeodeticTransformation
public static MathTransform createGeodeticTransformation(MathTransformFactory factory, Ellipsoid source, boolean isSource3D, Ellipsoid target, boolean isTarget3D, DatumShiftGrid<Angle, Length> grid) throws FactoryExceptionCreates a transformation between two geographic CRS. This factory method combines theInterpolatedGeocentricTransforminstance with the steps needed for converting values between degrees to radians. The transform works with input and output coordinates in the following units:- longitudes in degrees relative to the prime meridian (usually Greenwich),
- latitudes in degrees,
- optionally heights above the ellipsoid, in same units as the source ellipsoids axes.
gridinstance shall expect geographic coordinates (λ,φ) in radians.- Parameters:
factory- the factory to use for creating the transform.source- the source ellipsoid.isSource3D-trueif the source coordinates have a height.target- the target ellipsoid.isTarget3D-trueif the target coordinates have a height.grid- the grid of datum shifts from source to target datum. TheDatumShiftGrid.interpolateInCell(…)method shall compute (ΔX, ΔY, ΔZ) translations from source to target in the unit of source ellipsoid axes.- Returns:
- the transformation between geographic coordinates in degrees.
- Throws:
FactoryException- if an error occurred while creating a transform.
-
getSourceDimensions
public int getSourceDimensions()Gets the dimension of input points.- Specified by:
getSourceDimensionsin interfaceMathTransform- Specified by:
getSourceDimensionsin classAbstractMathTransform- Returns:
- the input dimension, which is 2 or 3.
- See Also:
-
getTargetDimensions
public int getTargetDimensions()Gets the dimension of output points.- Specified by:
getTargetDimensionsin interfaceMathTransform- Specified by:
getTargetDimensionsin classAbstractMathTransform- Returns:
- the output dimension, which is 2 or 3.
- See Also:
-
transform
public Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws TransformException Transforms the (λ,φ) or (λ,φ,h) coordinates between two geographic CRS, and optionally returns the derivative at that location.- Specified by:
transformin classAbstractMathTransform- Parameters:
srcPts- the array containing the source coordinates (cannot benull).srcOff- the offset to the point to be transformed in the source array.dstPts- the array into which the transformed coordinates is returned. May be the same assrcPts. May benullif only the derivative matrix is desired.dstOff- the offset to the location of the transformed point that is stored in the destination array.derivate-truefor computing the derivative, orfalseif not needed.- Returns:
- the matrix of the transform derivative at the given source position,
or
nullif thederivateargument isfalse. - Throws:
TransformException- if the point cannot be transformed or if a problem occurred while calculating the derivative.- See Also:
-
inverse
Returns the inverse of this interpolated geocentric transform. The source ellipsoid of the returned transform will be the target ellipsoid of this transform, and conversely.- Specified by:
inversein interfaceMathTransform- Overrides:
inversein classAbstractMathTransform- Returns:
- a transform from the target ellipsoid to the source ellipsoid of this transform.
-