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
GeocentricAffineBetweenGeographic
subclass.
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enum
The transformation type (translation, frame rotation, etc.). -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final double
The tolerance factor for comparing theBursaWolfParameters
values.(package private) static final org.opengis.parameter.ParameterDescriptor
<Double> The operation parameter descriptor for the Scale difference (dS) parameter value.(package private) static final org.opengis.parameter.ParameterDescriptor
<Double> The operation parameter descriptor for the X-axis rotation (rX) parameter value.(package private) static final org.opengis.parameter.ParameterDescriptor
<Double> The operation parameter descriptor for the Y-axis rotation (rY) parameter value.(package private) static final org.opengis.parameter.ParameterDescriptor
<Double> The operation parameter descriptor for the Z-axis rotation (rZ) parameter value.private static final long
Serial number for inter-operability with different versions.static final org.opengis.parameter.ParameterDescriptor
<Double> The operation parameter descriptor for the X-axis translation (tX) parameter value.static final org.opengis.parameter.ParameterDescriptor
<Double> The operation parameter descriptor for the Y-axis translation (tY) parameter value.private final GeocentricAffine.Type
The transformation type (translation, frame rotation, etc.).static final org.opengis.parameter.ParameterDescriptor
<Double> The operation parameter descriptor for the Z-axis translation (tZ) parameter value.Fields inherited from class org.apache.sis.internal.referencing.provider.GeodeticOperation
redimensioned
Fields inherited from class org.apache.sis.internal.referencing.provider.AbstractProvider
sourceCSType, sourceOnEllipsoid, targetCSType, targetOnEllipsoid
Fields inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
Fields inherited from interface org.opengis.referencing.operation.OperationMethod
FORMULA_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionGeocentricAffine
(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.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. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
asDatumShift
(List<Object> transforms) Given a transformation chain, conditionally replaces the affine transform elements by an alternative object showing the Bursa-Wolf parameters.org.opengis.referencing.operation.MathTransform
createMathTransform
(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.parameter.ParameterValueGroup values) Creates a math transform from the specified group of parameter values.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.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.private static org.opengis.parameter.ParameterDescriptor
<Double> createRotation
(ParameterBuilder builder, String name, String alias) Convenience method for building the rotation parameters.private static boolean
isOperation
(String expected, Object actual) Returnstrue
if the given object is an operation of the given name.Methods inherited from class org.apache.sis.internal.referencing.provider.GeodeticOperation
inverse, redimension, variant3D
Methods inherited from class org.apache.sis.internal.referencing.provider.AbstractProvider
addIdentifierAndLegacy, addNameAndLegacy, builder, createLatitude, createLongitude, createMandatoryLatitude, createScale, createShift, createZeroConstant, getOperationType, recoverableException, resolveAmbiguity
Methods inherited from class org.apache.sis.referencing.operation.DefaultOperationMethod
castOrCopy, computeHashCode, equals, formatTo, getFormula, getInterface, getParameters, getSourceDimensions, getTargetDimensions, redimension
Methods inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
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.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
BURSAWOLF_TOLERANCE
private static final double BURSAWOLF_TOLERANCEThe tolerance factor for comparing theBursaWolfParameters
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
-
TY
-
TZ
-
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 - Value domain: [-648000.0 … 648000.0]″
-
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 - Value domain: [-648000.0 … 648000.0]″
-
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 - Value domain: [-648000.0 … 648000.0]″
-
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
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:
parameters
- description of parameters expected by this operation.sourceCSType
- base interface of the coordinate system of source coordinates.sourceDimensions
- number of dimensions in the source CRS of this operation method.sourceOnEllipsoid
- whether the operation needs source ellipsoid axis lengths.targetCSType
- base interface of the coordinate system of target coordinates.targetDimensions
- number of dimensions in the target CRS of this operation method.targetOnEllipsoid
- whether the operation needs target ellipsoid axis lengths.redimensioned
- providers for all combinations between 2D and 3D cases, ornull
.type
- the operation type as an enumeration value.
-
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
- thePARAMETERS
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 theGeocentricAffine
subclasses, unless the specifiedmethod
argument isDatumShiftMethod.NONE
. If no single operation method can be used, then this method returnsnull
.This method does not change the coordinate system type. The source and target coordinate systems can be both
EllipsoidalCS
or bothCartesianCS
. Any other type or mix of types (e.g. aEllipsoidalCS
source andCartesianCS
target) will cause this method to returnnull
. 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, ornull
if there is no datum shift information.method
- the preferred datum shift method. Note thatcreateParameters(…)
may overwrite.- Returns:
- the parameter values, or
null
if no single operation method can be found.
-
asDatumShift
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 ofAbstractMathTransform.beforeFormat(List, int, boolean)
except that we need to perform theforDatumShift(…)
work only afterbeforeFormat(…)
finished its work for allContextualParameters
, including theEllipsoidToCentricTransform
's one.- Parameters:
transforms
- the full chain of concatenated transforms.
-
isOperation
Returnstrue
if the given object is an operation of the given name.
-