Class InterpolatedMolodenskyTransform
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.operation.transform.AbstractMathTransform
org.apache.sis.referencing.operation.transform.DatumShiftTransform
org.apache.sis.referencing.operation.transform.MolodenskyFormula
org.apache.sis.referencing.operation.transform.InterpolatedMolodenskyTransform
- All Implemented Interfaces:
Serializable
,Parameterized
,LenientComparable
,org.opengis.referencing.operation.MathTransform
- Direct Known Subclasses:
InterpolatedMolodenskyTransform.Inverse
,InterpolatedMolodenskyTransform2D
Transforms between two geographic CRS by performing geocentric translations interpolated from a grid file, but using
Molodensky approximation. This transformation is conceptually defined as a translation in geocentric coordinates
as performed by
InterpolatedGeocentricTransform
, but uses the Molodensy
(non-abridged) approximation for performance reasons.
Errors are less than 3 centimetres for the "France geocentric interpolation" (ESPG:9655).
By comparison, the finest accuracy reported in the grid file for France is 5 centimetres.
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 interpolated translations directly on geographic coordinates.
This relatively simple case is handled by InterpolatedTransform
.
But in the InterpolatedMolodenskyTransform
case, the interpolated translations are rather the
(MolodenskyFormula.tX, MolodenskyFormula.tY, MolodenskyFormula.tZ) parameters of a Molodensky transformation.
- Since:
- 0.7
- Version:
- 1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
The inverse of the enclosingInterpolatedMolodenskyTransform
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.opengis.parameter.ParameterDescriptorGroup
Parameter descriptor to use with the contextual parameters for the forward and inverse transformations.private final InterpolatedMolodenskyTransform
The inverse of this interpolated Molodensky transform.private static final org.opengis.parameter.ParameterDescriptorGroup
Parameter descriptor to use with the contextual parameters for the forward and inverse transformations.private static final long
Serial number for inter-operability with different versions.Fields inherited from class org.apache.sis.referencing.operation.transform.MolodenskyFormula
ANGULAR_SCALE, eccentricitySquared, isAbridged, isSource3D, isTarget3D, semiMajor, tX, tY, tZ, Δa, Δfmod
Fields inherited from class org.apache.sis.referencing.operation.transform.DatumShiftTransform
context, grid
Fields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
MAXIMUM_BUFFER_SIZE, MAXIMUM_FAILURES
-
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
InterpolatedMolodenskyTransform
(InterpolatedMolodenskyTransform inverse, org.opengis.referencing.datum.Ellipsoid source, org.opengis.referencing.datum.Ellipsoid target) Constructs the inverse of an interpolated Molodensky transform.protected
InterpolatedMolodenskyTransform
(org.opengis.referencing.datum.Ellipsoid source, boolean isSource3D, org.opengis.referencing.datum.Ellipsoid target, boolean isTarget3D, DatumShiftGrid<javax.measure.quantity.Angle, javax.measure.quantity.Length> grid) Creates a transform from the specified parameters. -
Method Summary
Modifier and TypeMethodDescription(package private) final void
completeParameters
(Parameters pg, double semiMinor, javax.measure.Unit<?> unit, double Δf) Invoked by constructor and byMolodenskyFormula.getParameterValues()
for setting all parameters other than axis lengths.static org.opengis.referencing.operation.MathTransform
createGeodeticTransformation
(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.referencing.datum.Ellipsoid source, boolean isSource3D, org.opengis.referencing.datum.Ellipsoid target, boolean isTarget3D, DatumShiftGrid<javax.measure.quantity.Angle, javax.measure.quantity.Length> grid) Creates a transformation between two geographic CRS.org.opengis.parameter.ParameterDescriptorGroup
Returns a description of the internal parameters of thisInterpolatedMolodenskyTransform
transform.org.opengis.referencing.operation.MathTransform
inverse()
Returns the inverse of this interpolated Molodensky transform.org.opengis.referencing.operation.Matrix
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.void
transform
(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms the (λ,φ) or (λ,φ,h) coordinates between two geographic CRS.Methods inherited from class org.apache.sis.referencing.operation.transform.MolodenskyFormula
computeHashCode, equals, getParameterValues, getSourceDimensions, getTargetDimensions, transform
Methods inherited from class org.apache.sis.referencing.operation.transform.DatumShiftTransform
ensureGeocentricTranslation, getContextualParameters, normalizedToGridX, normalizedToGridY, setContextParameters
Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
beforeFormat, derivative, equals, formatTo, getDomain, hashCode, isIdentity, isInverseEquals, mismatchedDimension, transform, transform, transform, transform, tryConcatenate
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.referencing.operation.MathTransform
toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
DESCRIPTOR
private static final org.opengis.parameter.ParameterDescriptorGroup DESCRIPTORParameter descriptor to use with the contextual parameters for the forward and inverse transformations. We do not use directly the "France geocentric interpolation" (ESPG:9655) descriptor because thisInterpolatedMolodenskyTransform
is an approximation ofInterpolatedGeocentricTransform
and the conventions used by SIS are different than EPSG:9655 ones. -
INVERSE
private static final org.opengis.parameter.ParameterDescriptorGroup INVERSEParameter descriptor to use with the contextual parameters for the forward and inverse transformations. We do not use directly the "France geocentric interpolation" (ESPG:9655) descriptor because thisInterpolatedMolodenskyTransform
is an approximation ofInterpolatedGeocentricTransform
and the conventions used by SIS are different than EPSG:9655 ones. -
inverse
The inverse of this interpolated Molodensky transform.- See Also:
-
-
Constructor Details
-
InterpolatedMolodenskyTransform
InterpolatedMolodenskyTransform(InterpolatedMolodenskyTransform inverse, org.opengis.referencing.datum.Ellipsoid source, org.opengis.referencing.datum.Ellipsoid target) Constructs the inverse of an interpolated Molodensky transform.- Parameters:
inverse
- the transform for which to create the inverse.source
- the source ellipsoid of the giveninverse
transform.target
- the target ellipsoid of the giveninverse
transform.
-
InterpolatedMolodenskyTransform
protected InterpolatedMolodenskyTransform(org.opengis.referencing.datum.Ellipsoid source, boolean isSource3D, org.opengis.referencing.datum.Ellipsoid target, boolean isTarget3D, DatumShiftGrid<javax.measure.quantity.Angle, javax.measure.quantity.Length> grid) Creates a transform from the specified parameters. ThisInterpolatedMolodenskyTransform
class 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 than the source ellipsoid axes.
InterpolatedMolodenskyTransform
instances need to be concatenated with the following affine transforms:- Normalization before
InterpolatedMolodenskyTransform
:- Conversion of (λ,φ) from degrees to radians.
- Denormalization after
InterpolatedMolodenskyTransform
:- Conversion of (λ,φ) from radians to degrees.
InterpolatedMolodenskyTransform
construction, the full conversion chain including the above affine transforms can be created byDatumShiftTransform.getContextualParameters().completeTransform(factory, this)}
.- Parameters:
source
- the source ellipsoid.isSource3D
-true
if the source coordinates have a height.target
- the target ellipsoid.isTarget3D
-true
if 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 org.opengis.referencing.operation.MathTransform createGeodeticTransformation(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.referencing.datum.Ellipsoid source, boolean isSource3D, org.opengis.referencing.datum.Ellipsoid target, boolean isTarget3D, DatumShiftGrid<javax.measure.quantity.Angle, javax.measure.quantity.Length> grid) throws org.opengis.util.FactoryExceptionCreates a transformation between two geographic CRS. This factory method combines theInterpolatedMolodenskyTransform
instance 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 than the source ellipsoids axes.
grid
instance shall expect geographic coordinates (λ,φ) in radians.- Parameters:
factory
- the factory to use for creating the transform.source
- the source ellipsoid.isSource3D
-true
if the source coordinates have a height.target
- the target ellipsoid.isTarget3D
-true
if 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:
org.opengis.util.FactoryException
- if an error occurred while creating a transform.
-
completeParameters
final void completeParameters(Parameters pg, double semiMinor, javax.measure.Unit<?> unit, double Δf) Invoked by constructor and byMolodenskyFormula.getParameterValues()
for setting all parameters other than axis lengths.- Overrides:
completeParameters
in classMolodenskyFormula
- Parameters:
pg
- where to set the parameters.semiMinor
- the semi minor axis length, in unit ofunit
.unit
- the unit of measurement to declare.\u0394f
- ignored.
-
transform
public org.opengis.referencing.operation.Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws org.opengis.referencing.operation.TransformException Transforms the (λ,φ) or (λ,φ,h) coordinates between two geographic CRS, and optionally returns the derivative at that location.- Specified by:
transform
in 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 thansrcPts
. May benull
if only the derivative matrix is desired.dstOff
- the offset to the location of the transformed point that is stored in the destination array.derivate
-true
for computing the derivative, orfalse
if not needed.- Returns:
- the matrix of the transform derivative at the given source position,
or
null
if thederivate
argument isfalse
. - Throws:
org.opengis.referencing.operation.TransformException
- if the point cannot be transformed or if a problem occurred while calculating the derivative.- See Also:
-
transform
public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws org.opengis.referencing.operation.TransformException Transforms the (λ,φ) or (λ,φ,h) coordinates between two geographic CRS. This method performs the same work than the abovetransform(…)
method, but on an arbitrary number of coordinate tuples and without computing derivative.- Specified by:
transform
in interfaceorg.opengis.referencing.operation.MathTransform
- Overrides:
transform
in classAbstractMathTransform
- Parameters:
srcPts
- the array containing the source point coordinates.srcOff
- the offset to the first point to be transformed in the source array.dstPts
- the array into which the transformed point coordinates are returned. May be the same thansrcPts
.dstOff
- the offset to the location of the first transformed point that is stored in the destination array.numPts
- the number of point objects to be transformed.- Throws:
org.opengis.referencing.operation.TransformException
- if a point cannot be transformed.
-
inverse
public org.opengis.referencing.operation.MathTransform inverse()Returns the inverse of this interpolated Molodensky transform. The source ellipsoid of the returned transform will be the target ellipsoid of this transform, and conversely.- Specified by:
inverse
in interfaceorg.opengis.referencing.operation.MathTransform
- Overrides:
inverse
in classAbstractMathTransform
- Returns:
- a transform from the target ellipsoid to the source ellipsoid of this transform.
-
getParameterDescriptors
Returns a description of the internal parameters of thisInterpolatedMolodenskyTransform
transform. The returned group contains parameters for the source ellipsoid semi-axis lengths and the differences between source and target ellipsoid parameters.Note: this method is mostly for debugging purposes since the isolation of non-linear parameters in this class is highly implementation dependent. Most GIS applications will instead be interested in the contextual parameters.- Specified by:
getParameterDescriptors
in interfaceParameterized
- Overrides:
getParameterDescriptors
in classAbstractMathTransform
- Returns:
- a description of the internal parameters.
- See Also:
-