org.geotoolkit.referencing.operation
Class MathTransformProvider
Object
FormattableObject
AbstractIdentifiedObject
DefaultOperationMethod
MathTransformProvider
- All Implemented Interfaces:
- Serializable, Formattable, LenientComparable, IdentifiedObject, OperationMethod
- Direct Known Subclasses:
- Affine, EllipsoidToGeocentric, Exponential, GeocentricToEllipsoid, Logarithmic, LongitudeRotation, MapProjection, Molodensky, NADCON, NTv2, PositionVector7Param, RGF93
@Immutable
public abstract class MathTransformProvider
- extends DefaultOperationMethod
An operation method capable to create a
math transform from set of parameter values. Implementations of this class should be listed in the following file:
META-INF/services/org.geotoolkit.referencing.operation.MathTransformProvider
The default math transform factory will parse this
file in order to get all available providers on a system. If this file is bundle in many JAR
files, the factory will read all of them.
- Since:
- 1.2
- Version:
- 3.01
- Author:
- Martin Desruisseaux (IRD)
- See Also:
org.geotoolkit.referencing.operation.provider,
Serialized Form
- Module:
| Methods inherited from class AbstractIdentifiedObject |
equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, hashCode, nameMatches, nameMatches, nameMatches |
MathTransformProvider
public MathTransformProvider(int sourceDimension,
int targetDimension,
ParameterDescriptorGroup parameters)
- Constructs a math transform provider from a set of parameters. The provider
identifiers will be the same than the parameter
ones.
- Parameters:
sourceDimension - Number of dimensions in the source CRS of this operation method.targetDimension - Number of dimensions in the target CRS of this operation method.parameters - The set of parameters (never null).
MathTransformProvider
public MathTransformProvider(Map<String,?> properties,
int sourceDimension,
int targetDimension,
ParameterDescriptorGroup parameters)
- Constructs a math transform provider from a set of properties. The properties map is given
unchanged to the super-class constructor.
- Parameters:
properties - Set of properties. Should contains at least "name".sourceDimension - Number of dimensions in the source CRS of this operation method.targetDimension - Number of dimensions in the target CRS of this operation method.parameters - The set of parameters (never null).
getOperationType
public Class<? extends SingleOperation> getOperationType()
- Returns the operation type. It may be
SingleOperation.class,
Conversion.class,
Projection.class,
etc.
The default implementation returns SingleOperation.class.
Subclass should overrides this methods and returns the appropriate
OpenGIS interface type (not the implementation type).
- Returns:
- The GeoAPI interface implemented by this operation.
createMathTransform
protected abstract MathTransform createMathTransform(ParameterValueGroup values)
throws InvalidParameterNameException,
ParameterNotFoundException,
InvalidParameterValueException,
FactoryException
- Creates a math transform from the specified group of parameter values.
Subclasses can implements this method as in the example below:
double semiMajor = values.parameter("semi_major").doubleValue(SI.METRE);
double semiMinor = values.parameter("semi_minor").doubleValue(SI.METRE);
// etc...
return new MyTransform(semiMajor, semiMinor, ...);
- Parameters:
values - The group of parameter values.
- Returns:
- The created math transform.
- Throws:
InvalidParameterNameException - if the values contains an unknown parameter.
ParameterNotFoundException - if a required parameter was not found.
InvalidParameterValueException - if a parameter has an invalid value.
FactoryException - if the math transform can't be created for some other reason
(for example a required file was not found).
ensureValidValues
protected ParameterValueGroup ensureValidValues(ParameterValueGroup values)
throws InvalidParameterNameException,
InvalidParameterValueException
- Ensures that the given set of parameters contains only valid values.
This method compares all parameter names against the names declared in the
operation method parameter descriptor. If an unknown
parameter name is found, then an
InvalidParameterNameException is thrown.
This method also ensures that all values are assignable to the
expected class, are between the
minimum and
maximum values and are one of the
set of valid values. If the value
fails any of those tests, then an InvalidParameterValueException is thrown.
- Parameters:
values - The parameters values to check.
- Returns:
- The parameter values to use for math transform
construction. May be different than the supplied
values
argument if some missing values needed to be filled with default values.
- Throws:
InvalidParameterNameException - if a parameter name is unknown.
InvalidParameterValueException - if a parameter has an invalid value.
formatWKT
public String formatWKT(Formatter formatter)
- Format the inner part of a
Well
Known Text (WKT) element.
- Specified by:
formatWKT in interface Formattable- Overrides:
formatWKT in class DefaultOperationMethod
- Parameters:
formatter - The formatter to use.
- Returns:
- The WKT element name.
- See Also:
FormattableObject.toWKT(),
FormattableObject.toString()
Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.