Class DefaultMathTransformFactory.Context
Object
Context
- All Implemented Interfaces:
Serializable
- Enclosing class:
DefaultMathTransformFactory
Source and target coordinate systems for which a new parameterized transform is going to be used.
DefaultMathTransformFactory
uses this information for:
- Completing some parameters if they were not provided. In particular, the source ellipsoid can be used for providing values for the
"semi_major"
and"semi_minor"
parameters in map projections. - Swapping and scaling axes if the source or the target coordinate systems are not normalized.
OperationMethod
,
for example "Longitude rotation" (EPSG:9601) for changing the prime meridian.- Since:
- 0.7
- See Also:
Defined in the sis-referencing
module
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the parameter values used for the math transform creation, including the parameters completed by the factory.Returns the matrix that represent the affine transform to concatenate before or after the parameterized transform.Returns the source coordinate system, ornull
if unspecified.Returns the ellipsoid of the source ellipsoidal coordinate system, ornull
if it does not apply.Returns the target coordinate system, ornull
if unspecified.Returns the ellipsoid of the target ellipsoidal coordinate system, ornull
if it does not apply.void
Sets the source coordinate system to the given value.void
setSource
(EllipsoidalCS cs, Ellipsoid ellipsoid) Sets the source coordinate system and its associated ellipsoid to the given value.void
Sets the target coordinate system to the given value.void
setTarget
(EllipsoidalCS cs, Ellipsoid ellipsoid) Sets the target coordinate system and its associated ellipsoid to the given value.
-
Constructor Details
-
Context
public Context()Creates a new context with all properties initialized tonull
.
-
-
Method Details
-
setSource
Sets the source coordinate system to the given value. The source ellipsoid is unconditionally set tonull
.- Parameters:
cs
- the coordinate system to set as the source (can benull
).
-
setSource
Sets the source coordinate system and its associated ellipsoid to the given value.Design note: ellipsoidal coordinate systems and ellipsoids are associated indirectly, through a geodetic CRS. However this method expects those two components to be given explicitly instead of inferring them from aCoordinateReferenceSystem
for making clear thatMathTransformFactory
does not perform any geodetic datum analysis. For coordinate operations that take datum changes in account (including change of prime meridian), seeDefaultCoordinateOperationFactory
. This policy helps to enforce a separation of concerns.- Parameters:
cs
- the coordinate system to set as the source, ornull
.ellipsoid
- the ellipsoid associated to the given coordinate system, ornull
.
-
setTarget
Sets the target coordinate system to the given value. The target ellipsoid is unconditionally set tonull
.- Parameters:
cs
- the coordinate system to set as the target (can benull
).
-
setTarget
Sets the target coordinate system and its associated ellipsoid to the given value.Design note: seesetSource(EllipsoidalCS, Ellipsoid)
.- Parameters:
cs
- the coordinate system to set as the source, ornull
.ellipsoid
- the ellipsoid associated to the given coordinate system, ornull
.
-
getSourceCS
Returns the source coordinate system, ornull
if unspecified.- Returns:
- the source coordinate system, or
null
.
-
getSourceEllipsoid
Returns the ellipsoid of the source ellipsoidal coordinate system, ornull
if it does not apply. This information is valid only ifgetSourceCS()
returns an instance ofEllipsoidalCS
.- Returns:
- the ellipsoid of the source ellipsoidal coordinate system, or
null
if it does not apply.
-
getTargetCS
Returns the target coordinate system, ornull
if unspecified.- Returns:
- the target coordinate system, or
null
.
-
getTargetEllipsoid
Returns the ellipsoid of the target ellipsoidal coordinate system, ornull
if it does not apply. This information is valid only ifgetTargetCS()
returns an instance ofEllipsoidalCS
.- Returns:
- the ellipsoid of the target ellipsoidal coordinate system, or
null
if it does not apply.
-
getMatrix
Returns the matrix that represent the affine transform to concatenate before or after the parameterized transform. Therole
argument specifies which matrix is desired:NORMALIZATION
for the conversion from the source coordinate system to a normalized coordinate system, usually with (longitude, latitude) axis order in degrees or (easting, northing) in metres. This normalization needs to be applied before the parameterized transform.DENORMALIZATION
for the conversion from a normalized coordinate system to the target coordinate system, for example with (latitude, longitude) axis order. This denormalization needs to be applied after the parameterized transform.INVERSE_NORMALIZATION
andINVERSE_DENORMALIZATION
are also supported but rarely used.
DefaultMathTransformFactory.swapAndScaleAxes(MathTransform, Context)
. Users an override this method if they need to customize the normalization process.- Parameters:
role
- whether the normalization or denormalization matrix is desired.- Returns:
- the requested matrix, or
null
if thisContext
has no information about the coordinate system. - Throws:
FactoryException
- if an error occurred while computing the matrix.- See Also:
-
getCompletedParameters
Returns the parameter values used for the math transform creation, including the parameters completed by the factory.- Returns:
- the parameter values used by the factory.
- Throws:
IllegalStateException
- ifDefaultMathTransformFactory.createParameterizedTransform(ParameterValueGroup, Context)
has not yet been invoked.
-