|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.referencing.wkt.Formattable org.geotools.referencing.AbstractIdentifiedObject org.geotools.referencing.operation.DefaultOperationMethod org.geotools.referencing.operation.MathTransformProvider
An operation method capable to creates a math transform from set of parameter values. Implementations of this class should be listed in the following file:
The math transform factory will parse this file in order to gets all available providers on a system. If this file is bundle in many JAR files, the math transform factory will read all of them.
Nested Class Summary | |
protected static class |
MathTransformProvider.Delegate
The result of a call to createMathTransform .
|
Field Summary |
Fields inherited from class org.geotools.referencing.operation.DefaultOperationMethod |
sourceDimensions, targetDimensions |
Fields inherited from class org.geotools.referencing.AbstractIdentifiedObject |
EMPTY_ALIAS_ARRAY, EMPTY_IDENTIFIER_ARRAY, IDENTIFIER_COMPARATOR, NAME_COMPARATOR, REMARKS_COMPARATOR |
Fields inherited from interface org.opengis.referencing.operation.OperationMethod |
FORMULA_KEY |
Fields inherited from interface org.opengis.referencing.IdentifiedObject |
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY |
Constructor Summary | |
MathTransformProvider(int sourceDimensions,
int targetDimensions,
org.opengis.parameter.ParameterDescriptorGroup parameters)
Constructs a math transform provider from a set of parameters. |
|
MathTransformProvider(java.util.Map properties,
int sourceDimensions,
int targetDimensions,
org.opengis.parameter.ParameterDescriptorGroup parameters)
Constructs a math transform provider from a set of properties. |
Method Summary | |
protected static org.opengis.parameter.ParameterDescriptor |
createDescriptor(org.opengis.metadata.Identifier[] identifiers,
double defaultValue,
double minimum,
double maximum,
javax.units.Unit unit)
Constructs a parameter descriptor from a set of alias. |
protected static org.opengis.parameter.ParameterDescriptorGroup |
createDescriptorGroup(org.opengis.metadata.Identifier[] identifiers,
org.opengis.parameter.GeneralParameterDescriptor[] parameters)
Constructs a parameter group from a set of alias. |
protected abstract org.opengis.referencing.operation.MathTransform |
createMathTransform(org.opengis.parameter.ParameterValueGroup values)
Creates a math transform from the specified group of parameter values. |
protected static org.opengis.parameter.ParameterDescriptor |
createOptionalDescriptor(org.opengis.metadata.Identifier[] identifiers,
double minimum,
double maximum,
javax.units.Unit unit)
Constructs an optional parameter descriptor from a set of alias. |
protected static double |
doubleValue(org.opengis.parameter.ParameterDescriptor param,
org.opengis.parameter.ParameterValueGroup group)
Returns the parameter value for the specified operation parameter. |
protected org.opengis.parameter.ParameterValueGroup |
ensureValidValues(org.opengis.parameter.ParameterValueGroup values)
Ensures that the given set of parameters contains only valid values. |
protected java.lang.String |
formatWKT(Formatter formatter)
Format the inner part of a Well Known Text (WKT) element. |
protected java.lang.Class |
getOperationType()
Returns the operation type. |
protected static int |
intValue(org.opengis.parameter.ParameterDescriptor param,
org.opengis.parameter.ParameterValueGroup group)
Returns the parameter value for the specified operation parameter. |
protected static java.lang.String |
stringValue(org.opengis.parameter.ParameterDescriptor param,
org.opengis.parameter.ParameterValueGroup group)
Returns the parameter value for the specified operation parameter. |
protected static java.lang.Object |
value(org.opengis.parameter.ParameterDescriptor param,
org.opengis.parameter.ParameterValueGroup group)
Returns the parameter value for the specified operation parameter. |
Methods inherited from class org.geotools.referencing.operation.DefaultOperationMethod |
checkDimensions, equals, getFormula, getParameters, getSourceDimensions, getTargetDimensions, hashCode |
Methods inherited from class org.geotools.referencing.AbstractIdentifiedObject |
asSet, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, nameMatches, nameMatches |
Methods inherited from class org.geotools.referencing.wkt.Formattable |
toString, toWKT, toWKT, 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 |
Constructor Detail |
public MathTransformProvider(int sourceDimensions, int targetDimensions, org.opengis.parameter.ParameterDescriptorGroup parameters)
sourceDimensions
- Number of dimensions in the source CRS of this operation method.targetDimensions
- Number of dimensions in the target CRS of this operation method.parameters
- The set of parameters (never ).public MathTransformProvider(java.util.Map properties, int sourceDimensions, int targetDimensions, org.opengis.parameter.ParameterDescriptorGroup parameters)
properties
- Set of properties. Should contains at least "name"
.sourceDimensions
- Number of dimensions in the source CRS of this operation method.targetDimensions
- Number of dimensions in the target CRS of this operation method.parameters
- The set of parameters (never ).Method Detail |
protected java.lang.Class getOperationType()
Operation.class
,
Conversion.class
,
Projection.class
,
etc.
The default implementation returns .
Subclass should overrides this methods and returns the appropriate
OpenGIS interface type (not the implementation type).
protected abstract org.opengis.referencing.operation.MathTransform createMathTransform(org.opengis.parameter.ParameterValueGroup values) throws org.opengis.parameter.InvalidParameterNameException, org.opengis.parameter.ParameterNotFoundException, org.opengis.parameter.InvalidParameterValueException, org.opengis.referencing.FactoryException
double semiMajor = values.parameter("semi_major").doubleValue(SI.METER); double semiMinor = values.parameter("semi_minor").doubleValue(SI.METER); // etc... return new MyTransform(semiMajor, semiMinor, ...);
values
- The group of parameter values.
org.opengis.parameter.InvalidParameterNameException
- if the values contains an unknow parameter.
org.opengis.parameter.ParameterNotFoundException
- if a required parameter was not found.
org.opengis.parameter.InvalidParameterValueException
- if a parameter has an invalid value.
org.opengis.referencing.FactoryException
- if the math transform can't be created for some other reason
(for example a required file was not found).MathTransformProvider.Delegate
protected static org.opengis.parameter.ParameterDescriptor createDescriptor(org.opengis.metadata.Identifier[] identifiers, double defaultValue, double minimum, double maximum, javax.units.Unit unit)
OGC
and EPSG
for example.
The first entry in the array is both the main name and the identifiers. All others are aliases.
identifiers
- The parameter identifiers. Most contains at least one entry.defaultValue
- The default value for the parameter, or Double.NaN
if none.minimum
- The minimum parameter value, or Double.NEGATIVE_INFINITY
if none.maximum
- The maximum parameter value, or Double.POSITIVE_INFINITY
if none.unit
- The unit for default, minimum and maximum values.protected static org.opengis.parameter.ParameterDescriptor createOptionalDescriptor(org.opengis.metadata.Identifier[] identifiers, double minimum, double maximum, javax.units.Unit unit)
createDescriptor(org.opengis.metadata.Identifier[], double, double, double, javax.units.Unit)
.
identifiers
- The parameter identifiers. Most contains at least one entry.minimum
- The minimum parameter value, or Double.NEGATIVE_INFINITY
if none.maximum
- The maximum parameter value, or Double.POSITIVE_INFINITY
if none.unit
- The unit for default, minimum and maximum values.protected static org.opengis.parameter.ParameterDescriptorGroup createDescriptorGroup(org.opengis.metadata.Identifier[] identifiers, org.opengis.parameter.GeneralParameterDescriptor[] parameters)
OGC
and EPSG
for example.
Special rules:
GenericName
interface, it is
an identifiers.
identifiers
- The operation identifiers. Most contains at least one entry.parameters
- The set of parameters, or or an empty array if none.protected org.opengis.parameter.ParameterValueGroup ensureValidValues(org.opengis.parameter.ParameterValueGroup values) throws org.opengis.parameter.InvalidParameterNameException, org.opengis.parameter.InvalidParameterValueException
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.
values
- The parameters values to check.
org.opengis.parameter.InvalidParameterNameException
- if a parameter name is unknow.
org.opengis.parameter.InvalidParameterValueException
- if a parameter has an invalid value.protected static java.lang.Object value(org.opengis.parameter.ParameterDescriptor param, org.opengis.parameter.ParameterValueGroup group) throws org.opengis.parameter.ParameterNotFoundException
param
- The parameter to look for.group
- The parameter value group to search into.
org.opengis.parameter.ParameterNotFoundException
- if the parameter is not found.Parameters
class.protected static java.lang.String stringValue(org.opengis.parameter.ParameterDescriptor param, org.opengis.parameter.ParameterValueGroup group) throws org.opengis.parameter.ParameterNotFoundException
param
- The parameter to look for.group
- The parameter value group to search into.
org.opengis.parameter.ParameterNotFoundException
- if the parameter is not found.Parameters
class.protected static int intValue(org.opengis.parameter.ParameterDescriptor param, org.opengis.parameter.ParameterValueGroup group) throws org.opengis.parameter.ParameterNotFoundException
param
- The parameter to look for.group
- The parameter value group to search into.
org.opengis.parameter.ParameterNotFoundException
- if the parameter is not found.Parameters
class.protected static double doubleValue(org.opengis.parameter.ParameterDescriptor param, org.opengis.parameter.ParameterValueGroup group) throws org.opengis.parameter.ParameterNotFoundException
param
- The parameter to look for.group
- The parameter value group to search into.
org.opengis.parameter.ParameterNotFoundException
- if the parameter is not found.Parameters
class.protected java.lang.String formatWKT(Formatter formatter)
formatWKT
in class DefaultOperationMethod
formatter
- The formatter to use.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |