Class GeocentricAffine

All Implemented Interfaces:
Serializable, Formattable, MathTransformProvider, Deprecable, LenientComparable, org.opengis.referencing.IdentifiedObject, org.opengis.referencing.operation.OperationMethod
Direct Known Subclasses:
CoordinateFrameRotation, GeocentricAffineBetweenGeographic, GeocentricTranslation, PositionVector7Param

public abstract class GeocentricAffine extends GeodeticOperation
The base class of operation methods performing a translation, rotation and/or scale in geocentric coordinates. Those methods may or may not include a Geographic/Geocentric conversion before the operation in geocentric domain, depending on whether or not implementations extend the GeocentricAffineBetweenGeographic subclass.
Note on class name: the GeocentricAffine class name is chosen as a generalization of GeocentricTranslation. "Geocentric translations" is an operation name defined by EPSG.
Since:
0.7
Version:
1.3
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serial number for inter-operability with different versions.
      See Also:
    • BURSAWOLF_TOLERANCE

      private static final double BURSAWOLF_TOLERANCE
      The tolerance factor for comparing the BursaWolfParameters values. We use a tolerance of 1E-6 (0.01 / 10000) based on the knowledge that the translation terms are in metres and the rotation terms have the same order of magnitude. Actually we could use a value of zero, but we add a small tolerance for rounding errors.
      See Also:
    • TX

      public static final org.opengis.parameter.ParameterDescriptor<Double> TX
      The operation parameter descriptor for the X-axis translation (tX) parameter value. Valid values range from negative to positive infinity. Units are metres.
      Parameter names
      EPSG: X-axis translation
      OGC: dx
    • TY

      public static final org.opengis.parameter.ParameterDescriptor<Double> TY
      The operation parameter descriptor for the Y-axis translation (tY) parameter value. Valid values range from negative to positive infinity. Units are metres.
      Parameter names
      EPSG: Y-axis translation
      OGC: dy
    • TZ

      public static final org.opengis.parameter.ParameterDescriptor<Double> TZ
      The operation parameter descriptor for the Z-axis translation (tZ) parameter value. Valid values range from negative to positive infinity. Units are metres.
      Parameter names
      EPSG: Z-axis translation
      OGC: dz
    • RX

      static final org.opengis.parameter.ParameterDescriptor<Double> RX
      The operation parameter descriptor for the X-axis rotation (rX) parameter value. Units are arc-seconds.
      Parameter names
      EPSG: X-axis rotation
      OGC: ex
      Notes:
      • Value domain: [-648000.0 … 648000.0]″
    • RY

      static final org.opengis.parameter.ParameterDescriptor<Double> RY
      The operation parameter descriptor for the Y-axis rotation (rY) parameter value. Units are arc-seconds.
      Parameter names
      EPSG: Y-axis rotation
      OGC: ey
      Notes:
      • Value domain: [-648000.0 … 648000.0]″
    • RZ

      static final org.opengis.parameter.ParameterDescriptor<Double> RZ
      The operation parameter descriptor for the Z-axis rotation (rZ) parameter value. Units are arc-seconds.
      Parameter names
      EPSG: Z-axis rotation
      OGC: ez
      Notes:
      • Value domain: [-648000.0 … 648000.0]″
    • DS

      static final org.opengis.parameter.ParameterDescriptor<Double> DS
      The operation parameter descriptor for the Scale difference (dS) parameter value. Valid values range from negative to positive infinity. Units are parts per million.
      Parameter names
      EPSG: Scale difference
      OGC: ppm
    • type

      private final GeocentricAffine.Type type
      The transformation type (translation, frame rotation, etc.).
  • Constructor Details

    • GeocentricAffine

      GeocentricAffine(GeocentricAffine.Type operationType, org.opengis.parameter.ParameterDescriptorGroup parameters, Class<? extends org.opengis.referencing.cs.CoordinateSystem> sourceCSType, int sourceDimensions, boolean sourceOnEllipsoid, Class<? extends org.opengis.referencing.cs.CoordinateSystem> targetCSType, int targetDimensions, boolean targetOnEllipsoid, GeodeticOperation[] redimensioned)
      Constructs a provider with the specified parameters.
      Parameters:
      type - the operation type as an enumeration value.
      parameters - description of parameters expected by this operation.
      sourceDimensions - number of dimensions in the source CRS of this operation method.
      sourceCSType - base interface of the coordinate system of source coordinates.
      sourceOnEllipsoid - whether the operation needs source ellipsoid axis lengths.
      targetDimensions - number of dimensions in the target CRS of this operation method.
      targetCSType - base interface of the coordinate system of target coordinates.
      targetOnEllipsoid - whether the operation needs target ellipsoid axis lengths.
      redimensioned - providers for all combinations between 2D and 3D cases, or null.
    • GeocentricAffine

      GeocentricAffine(GeocentricAffine.Type operationType, org.opengis.parameter.ParameterDescriptorGroup parameters, int sourceDimensions, int targetDimensions, GeodeticOperation[] redimensioned)
      Constructs a provider with the specified parameters for an operation in Cartesian space.
  • Method Details

    • createRotation

      private static org.opengis.parameter.ParameterDescriptor<Double> createRotation(ParameterBuilder builder, String name, String alias)
      Convenience method for building the rotation parameters.
    • createMathTransform

      public org.opengis.referencing.operation.MathTransform createMathTransform(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.parameter.ParameterValueGroup values) throws org.opengis.util.FactoryException
      Creates a math transform from the specified group of parameter values. The default implementation creates an affine transform, but some subclasses will wrap that affine operation into Geographic/Geocentric conversions.
      Parameters:
      factory - the factory to use for creating concatenated transforms.
      values - the group of parameter values.
      Returns:
      the created math transform.
      Throws:
      org.opengis.util.FactoryException - if a transform cannot be created.
    • createParameters

      private static Parameters createParameters(org.opengis.parameter.ParameterDescriptorGroup descriptor, BursaWolfParameters parameters, boolean isTranslation)
      Creates parameter values for a Molodensky, Geocentric Translation or Position Vector transformation.
      Parameters:
      descriptor - the PARAMETERS constant of the subclass describing the operation to create.
      parameters - Bursa-Wolf parameters from which to get the values.
      isTranslation - true if the operation contains only translation terms.
      Returns:
      the operation parameters with their values initialized.
    • createParameters

      public static org.opengis.parameter.ParameterValueGroup createParameters(org.opengis.referencing.cs.CoordinateSystem sourceCS, org.opengis.referencing.cs.CoordinateSystem targetCS, org.opengis.referencing.operation.Matrix datumShift, DatumShiftMethod method)
      Returns the parameters for creating a datum shift operation. The operation method will be one of the GeocentricAffine subclasses, unless the specified method argument is DatumShiftMethod.NONE. If no single operation method can be used, then this method returns null.

      This method does not change the coordinate system type. The source and target coordinate systems can be both EllipsoidalCS or both CartesianCS. Any other type or mix of types (e.g. a EllipsoidalCS source and CartesianCS target) will cause this method to return null. In such case, it is caller's responsibility to apply the datum shift itself in Cartesian geocentric coordinates.

      Parameters:
      sourceCS - the source coordinate system. Only the type and number of dimensions is checked.
      targetCS - the target coordinate system. Only the type and number of dimensions is checked.
      datumShift - the datum shift as a matrix, or null if there is no datum shift information.
      method - the preferred datum shift method. Note that createParameters(…) may overwrite.
      Returns:
      the parameter values, or null if no single operation method can be found.
    • asDatumShift

      public static void asDatumShift(List<Object> transforms)
      Given a transformation chain, conditionally replaces the affine transform elements by an alternative object showing the Bursa-Wolf parameters. The replacement is applied if and only if the affine transform is a scale, translation or rotation in the geocentric domain.

      This method is invoked only by ConcatenatedTransform.getPseudoSteps() for the need of WKT formatting. The purpose of this method is very similar to the purpose of AbstractMathTransform.beforeFormat(List, int, boolean) except that we need to perform the forDatumShift(…) work only after beforeFormat(…) finished its work for all ContextualParameters, including the EllipsoidToCentricTransform's one.

      Parameters:
      transforms - the full chain of concatenated transforms.
    • isOperation

      private static boolean isOperation(String expected, Object actual)
      Returns true if the given object is an operation of the given name.