Module org.opengis.geoapi.example
Package org.opengis.example.referencing
Class SimpleTransformFactory
Object
SimpleTransformFactory
- All Implemented Interfaces:
MathTransformFactory
,Factory
A
MathTransformFactory
for creating SimpleTransform
instances.
The only methods supported by this simple implementation are:
getVendor()
getAvailableMethods(Class)
, which returns an empty set.getLastMethodUsed()
, which returnsnull
.createAffineTransform(Matrix)
- Since:
- 3.1
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateAffineTransform
(Matrix matrix) Creates an affine transform from a matrix.createBaseToDerived
(CoordinateReferenceSystem baseCRS, ParameterValueGroup parameters, CoordinateSystem derivedCS) Creates a parameterized transform from a base CRS to a derived CS.createConcatenatedTransform
(MathTransform transform1, MathTransform transform2) Creates a transform by concatenating two existing transforms.createFromWKT
(String wkt) Creates a transform from a WKT string.createParameterizedTransform
(ParameterValueGroup parameters) Creates a transform from a group of parameters.createPassThroughTransform
(int firstAffectedCoordinate, MathTransform subTransform, int numTrailingCoordinates) Creates a transform which passes through a subset of coordinates to another transform.getAvailableMethods
(Class<? extends SingleOperation> type) Returns a set of available methods for math transforms.getDefaultParameters
(String method) Returns the default parameter values for a math transform using the given method.Returns the operation method used for the latest call tocreateParameterizedTransform
, ornull
if not applicable.Returns the implementer of this factory.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface MathTransformFactory
createFromXML
-
Constructor Details
-
SimpleTransformFactory
public SimpleTransformFactory()Creates a new factory.
-
-
Method Details
-
getVendor
Returns the implementer of this factory. -
getAvailableMethods
Returns a set of available methods for math transforms. The default implementation returns an empty set.- Specified by:
getAvailableMethods
in interfaceMathTransformFactory
- Parameters:
type
-SingleOperation.class
for fetching all operation methods,Projection.class
for fetching only map projection methods, etc.- Returns:
- methods available in this factory for coordinate operations of the given type.
- See Also:
-
getLastMethodUsed
Returns the operation method used for the latest call tocreateParameterizedTransform
, ornull
if not applicable. The default implementation returnsnull
in all cases.- Specified by:
getLastMethodUsed
in interfaceMathTransformFactory
- Returns:
- the last method used by a
create(…)
constructor, ornull
if unknown of unsupported. - See Also:
-
getDefaultParameters
Returns the default parameter values for a math transform using the given method. The default implementation throws an exception in all cases since parameterized transforms are not implemented by this simple factory.- Specified by:
getDefaultParameters
in interfaceMathTransformFactory
- Parameters:
method
- the case insensitive name of the coordinate operation method to search for.- Returns:
- a new group of parameter values for the
OperationMethod
identified by the given name. - Throws:
NoSuchIdentifierException
- if there is no method registered for the given name or identifier.- See Also:
-
createBaseToDerived
public MathTransform createBaseToDerived(CoordinateReferenceSystem baseCRS, ParameterValueGroup parameters, CoordinateSystem derivedCS) throws FactoryException Creates a parameterized transform from a base CRS to a derived CS. The default implementation throws an exception in all cases since parameterized transforms are not implemented by this simple factory.- Specified by:
createBaseToDerived
in interfaceMathTransformFactory
- Parameters:
baseCRS
- the source coordinate reference system.parameters
- the parameter values for the transform.derivedCS
- the target coordinate system.- Returns:
- the parameterized transform from
baseCRS
toderivedCS
, including unit conversions and axis swapping. - Throws:
NoSuchIdentifierException
- if there is no transform registered for the coordinate operation method.FactoryException
- if the object creation failed. This exception is thrown if some required parameter has not been supplied, or has illegal value.
-
createParameterizedTransform
public MathTransform createParameterizedTransform(ParameterValueGroup parameters) throws FactoryException Creates a transform from a group of parameters. The default implementation throws an exception in all cases since parameterized transforms are not implemented by this simple factory.- Specified by:
createParameterizedTransform
in interfaceMathTransformFactory
- Parameters:
parameters
- the parameter values.- Returns:
- the parameterized transform.
- Throws:
NoSuchIdentifierException
- if there is no transform registered for the coordinate operation method.FactoryException
- if the object creation failed. This exception is thrown if some required parameter has not been supplied, or has illegal value.- See Also:
-
createAffineTransform
Creates an affine transform from a matrix. If the transform's input dimension isM
, and output dimension isN
, then the matrix will have size[N+1][M+1]
. The +1 in the matrix dimensions allows the matrix to do a shift, as well as a rotation. The[M][j]
element of the matrix will be the j'th coordinate of the moved origin. The[i][N]
element of the matrix will be 0 for i less thanM
, and 1 for i equalsM
.- Specified by:
createAffineTransform
in interfaceMathTransformFactory
- Parameters:
matrix
- the matrix used to define the affine transform.- Returns:
- the affine transform.
- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createConcatenatedTransform
public MathTransform createConcatenatedTransform(MathTransform transform1, MathTransform transform2) throws FactoryException Creates a transform by concatenating two existing transforms. The default implementation throws an exception in all cases since concatenated transforms are not implemented by this simple factory.- Specified by:
createConcatenatedTransform
in interfaceMathTransformFactory
- Parameters:
transform1
- the first transform to apply to points.transform2
- the second transform to apply to points.- Returns:
- the concatenated transform.
- Throws:
FactoryException
- if the object creation failed.
-
createPassThroughTransform
public MathTransform createPassThroughTransform(int firstAffectedCoordinate, MathTransform subTransform, int numTrailingCoordinates) throws FactoryException Creates a transform which passes through a subset of coordinates to another transform. The default implementation throws an exception in all cases since pass through transforms are not implemented by this simple factory.- Specified by:
createPassThroughTransform
in interfaceMathTransformFactory
- Parameters:
firstAffectedCoordinate
- the lowest index of the affected coordinates.subTransform
- transform to use for affected coordinates.numTrailingCoordinates
- number of trailing coordinates to pass through. Affected coordinates will range fromfirstAffectedCoordinate
inclusive todimTarget-numTrailingCoordinates
exclusive.- Returns:
- a pass through transform with the following dimensions:
Source: firstAffectedCoordinate + subTransform.getDimSource() + numTrailingCoordinates Target: firstAffectedCoordinate + subTransform.getDimTarget() + numTrailingCoordinates
- Throws:
FactoryException
- if the object creation failed.
-
createFromWKT
Creates a transform from a WKT string. The default implementation throws an exception in all cases since WKT parsing is not implemented by this simple factory.- Specified by:
createFromWKT
in interfaceMathTransformFactory
- Parameters:
wkt
- math transform encoded in Well-Known Text format.- Returns:
- the math transform (never
null
). - Throws:
FactoryException
- if the Well-Known Text can't be parsed, or if the math transform creation failed from some other reason.- See Also:
-