Class CoordinateSystemTransform
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.operation.transform.AbstractMathTransform
org.apache.sis.referencing.operation.transform.CoordinateSystemTransform
- All Implemented Interfaces:
Parameterized
,LenientComparable
,org.opengis.referencing.operation.MathTransform
- Direct Known Subclasses:
CartesianToPolar
,CartesianToSpherical
,PolarToCartesian
,SphericalToCartesian
Base class of conversions between coordinate systems.
Each subclass should have a singleton instance.
- Since:
- 0.7
- Version:
- 1.1
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
AbstractMathTransform.Inverse
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.opengis.referencing.operation.MathTransform
The complete transform, including conversion between degrees and radians.(package private) final ContextualParameters
An empty contextual parameter, used only for representing conversion from degrees to radians.private final int
Number of input and output dimensions.private final org.opengis.referencing.operation.OperationMethod
An operation method that describe this coordinate system conversion.private final org.opengis.referencing.operation.OperationMethod
The method augmented with one pass through dimension.private org.opengis.referencing.operation.MathTransform
Thecomplete
transform in aPassThroughTransform
with a 1 trailing coordinate.Fields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
MAXIMUM_BUFFER_SIZE, MAXIMUM_FAILURES
-
Constructor Summary
ConstructorsConstructorDescriptionCoordinateSystemTransform
(String method, String method3D, int dimension) Creates a new conversion between two types of coordinate system. -
Method Summary
Modifier and TypeMethodDescription(package private) final org.opengis.referencing.operation.MathTransform
completeTransform
(org.opengis.referencing.operation.MathTransformFactory factory) Returns the complete transform, including conversion between degrees and radians units.(package private) static org.opengis.referencing.operation.MathTransform
create
(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.referencing.cs.CoordinateSystem source, org.opengis.referencing.cs.CoordinateSystem target, ThreadLocal<org.opengis.referencing.operation.OperationMethod> lastMethod) Implementation ofDefaultMathTransformFactory.createCoordinateSystemChange(CoordinateSystem, CoordinateSystem, Ellipsoid)
, defined here for reducing theDefaultMathTransformFactory
weight in the common case where the conversions handled by this class are not needed.protected final ContextualParameters
Returns the contextual parameters.final org.opengis.parameter.ParameterValueGroup
Returns the empty set of parameter values.final int
Returns the number of dimensions in the source coordinate tuples.final int
Returns the number of dimensions in the target coordinate tuples.private static org.opengis.referencing.operation.OperationMethod
Creates an operation method of the given name.(package private) final org.opengis.referencing.operation.MathTransform
passthrough
(org.opengis.referencing.operation.MathTransformFactory factory) Returns the cylindrical, including conversion between degrees and radians units.Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
beforeFormat, computeHashCode, derivative, equals, equals, formatTo, getDomain, getParameterDescriptors, hashCode, inverse, isIdentity, isInverseEquals, mismatchedDimension, transform, transform, 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
-
dimension
private final int dimensionNumber of input and output dimensions. -
method
private final transient org.opengis.referencing.operation.OperationMethod methodAn operation method that describe this coordinate system conversion. This is used for providing a value inDefaultMathTransformFactory.getLastMethodUsed()
. -
method3D
private final transient org.opengis.referencing.operation.OperationMethod method3DThe method augmented with one pass through dimension. May be the same instance thanmethod
if that method is already 3D.Note: ifThis method is used formethod
is "Polar to Cartesian", thenmethod3D
is "Cylindrical to Cartesian".CoordinateOperation
WKT formatting. Contrarily tomethod
, thismethod3D
is never used forMathTransform
WKT. Instead, the latter case is represented by a concatenation ofmethod
with a pass-through. -
context
An empty contextual parameter, used only for representing conversion from degrees to radians. -
complete
private transient volatile org.opengis.referencing.operation.MathTransform completeThe complete transform, including conversion between degrees and radians.- See Also:
-
passthrough
private transient volatile org.opengis.referencing.operation.MathTransform passthroughThecomplete
transform in aPassThroughTransform
with a 1 trailing coordinate. This is used for supporting the cylindrical case on top the polar case.- See Also:
-
-
Constructor Details
-
CoordinateSystemTransform
Creates a new conversion between two types of coordinate system. Subclasses may need to invokeContextualParameters.normalizeGeographicInputs(double)
orContextualParameters.denormalizeGeographicOutputs(double)
after this constructor.
-
-
Method Details
-
method
Creates an operation method of the given name. -
completeTransform
final org.opengis.referencing.operation.MathTransform completeTransform(org.opengis.referencing.operation.MathTransformFactory factory) throws org.opengis.util.FactoryException Returns the complete transform, including conversion between degrees and radians units.- Throws:
org.opengis.util.FactoryException
-
passthrough
final org.opengis.referencing.operation.MathTransform passthrough(org.opengis.referencing.operation.MathTransformFactory factory) throws org.opengis.util.FactoryException Returns the cylindrical, including conversion between degrees and radians units. This method is legal only forPolarToCartesian
orCartesianToPolar
.- Throws:
org.opengis.util.FactoryException
-
getSourceDimensions
public final int getSourceDimensions()Returns the number of dimensions in the source coordinate tuples. Shall be equal togetSourceCS().getDimension()
.- Specified by:
getSourceDimensions
in interfaceorg.opengis.referencing.operation.MathTransform
- Specified by:
getSourceDimensions
in classAbstractMathTransform
- Returns:
- the number of dimensions of input points.
- See Also:
-
getTargetDimensions
public final int getTargetDimensions()Returns the number of dimensions in the target coordinate tuples. Shall be equal togetTargetCS().getDimension()
.- Specified by:
getTargetDimensions
in interfaceorg.opengis.referencing.operation.MathTransform
- Specified by:
getTargetDimensions
in classAbstractMathTransform
- Returns:
- the number of dimensions of output points.
- See Also:
-
getParameterValues
public final org.opengis.parameter.ParameterValueGroup getParameterValues()Returns the empty set of parameter values.- Specified by:
getParameterValues
in interfaceParameterized
- Overrides:
getParameterValues
in classAbstractMathTransform
- Returns:
- the parameter values for this math transform, or
null
if unspecified. Note that those parameters may be normalized (e.g. represent a transformation of an ellipsoid of semi-major axis length of 1). - See Also:
-
getContextualParameters
Returns the contextual parameters. This is used for telling to the Well Known Text (WKT) formatter that thisCoordinateSystemTransform
transform is usually preceeded or followed by a conversion between degree and radian units of measurement.- Overrides:
getContextualParameters
in classAbstractMathTransform
- Returns:
- the parameter values for the sequence of normalize →
this
→ denormalize transforms, ornull
if unspecified. Callers should not modify the returned parameters, since modifications (if allowed) will generally not be reflected back in thisMathTransform
.
-
create
static org.opengis.referencing.operation.MathTransform create(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.referencing.cs.CoordinateSystem source, org.opengis.referencing.cs.CoordinateSystem target, ThreadLocal<org.opengis.referencing.operation.OperationMethod> lastMethod) throws org.opengis.util.FactoryException Implementation ofDefaultMathTransformFactory.createCoordinateSystemChange(CoordinateSystem, CoordinateSystem, Ellipsoid)
, defined here for reducing theDefaultMathTransformFactory
weight in the common case where the conversions handled by this class are not needed.- Throws:
org.opengis.util.FactoryException
-