Class DefaultOperationMethod
Object
Formattable
AbstractIdentifiedObject
DefaultOperationMethod
- All Implemented Interfaces:
Serializable,IdentifiedObject,OperationMethod,PROJFormattable
- Direct Known Subclasses:
MathTransformProvider
public class DefaultOperationMethod
extends AbstractIdentifiedObject
implements OperationMethod, PROJFormattable
Definition of an algorithm used to perform a coordinate operation. Most operation methods use a number of operation
parameters, although some coordinate conversions use none. Each coordinate operation using the method assigns values
to these parameters.
- Since:
- 2.1
- Author:
- Martin Desruisseaux (IRD)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intNumber of dimensions in the source CRS of this operation method.protected final intNumber of dimensions in the target CRS of this operation method.Fields inherited from class AbstractIdentifiedObject
EMPTY_ALIAS_ARRAY, EMPTY_IDENTIFIER_ARRAY, IDENTIFIER_COMPARATOR, NAME_COMPARATOR, REMARKS_COMPARATORFields inherited from class Formattable
SINGLE_LINEFields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEYFields inherited from interface OperationMethod
FORMULA_KEY -
Constructor Summary
ConstructorsConstructorDescriptionDefaultOperationMethod(Map<String, ?> properties, int sourceDimensions, int targetDimensions, ParameterDescriptorGroup parameters) Constructs an operation method from a set of properties and a descriptor group.DefaultOperationMethod(MathTransform transform) Convenience constructor that creates an operation method from a math transform.Constructs a new operation method with the same values than the specified one.DefaultOperationMethod(OperationMethod method, int sourceDimensions, int targetDimensions) Constructs a new operation method with the same values than the specified one except the dimensions. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckDimensions(OperationMethod method, MathTransform transform) Checks if an operation method and a math transform have a compatible number of source and target dimensions.booleanequals(AbstractIdentifiedObject object, boolean compareMetadata) Compare this operation method with the specified object for equality.formatPROJ(PROJFormatter formatter) Format the inner part of a PROJFormattable object.protected StringFormat the inner part of a Well Known Text (WKT) element.Formula(s) or procedure used by this operation method.Returns the set of parameters.intNumber of dimensions in the source CRS of this operation method.intNumber of dimensions in the target CRS of this operation method.inthashCode()Returns a hash code value for this operation method.Methods inherited from class AbstractIdentifiedObject
asSet, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, nameMatches, nameMatches, nameMatchesMethods inherited from class Formattable
cleanupThreadLocals, toString, toWKT, toWKT, toWKT, toWKTMethods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
sourceDimensions
protected final int sourceDimensionsNumber of dimensions in the source CRS of this operation method. -
targetDimensions
protected final int targetDimensionsNumber of dimensions in the target CRS of this operation method.
-
-
Constructor Details
-
DefaultOperationMethod
Convenience constructor that creates an operation method from a math transform. The information provided in the newly created object are approximative, and usually acceptable only as a fallback when no other information are available.- Parameters:
transform- The math transform to describe.
-
DefaultOperationMethod
Constructs a new operation method with the same values than the specified one. This copy constructor provides a way to wrap an arbitrary implementation into a Geotools one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. This constructor performs a shallow copy, i.e. the properties are not cloned.- Parameters:
method- The operation method to copy.
-
DefaultOperationMethod
Constructs a new operation method with the same values than the specified one except the dimensions.- Parameters:
method- The operation method to copy.sourceDimensions- Number of dimensions in the source CRS of this operation method.targetDimensions- Number of dimensions in the target CRS of this operation method.
-
DefaultOperationMethod
public DefaultOperationMethod(Map<String, ?> properties, int sourceDimensions, int targetDimensions, ParameterDescriptorGroup parameters) Constructs an operation method from a set of properties and a descriptor group. The properties given in argument follow the same rules than for the super-class constructor. Additionally, the following properties are understood by this construtor:
Property name Value type Value given to "formula"StringorInternationalStringgetFormula()- 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, ornullif none.
-
-
Method Details
-
getFormula
Formula(s) or procedure used by this operation method. This may be a reference to a publication. Note that the operation method may not be analytic, in which case this attribute references or contains the procedure, not an analytic formula.- Specified by:
getFormulain interfaceOperationMethod- Returns:
- The formula used by this method.
-
getSourceDimensions
public int getSourceDimensions()Number of dimensions in the source CRS of this operation method.- Specified by:
getSourceDimensionsin interfaceOperationMethod- Returns:
- The dimension of source CRS.
-
getTargetDimensions
public int getTargetDimensions()Number of dimensions in the target CRS of this operation method.- Specified by:
getTargetDimensionsin interfaceOperationMethod- Returns:
- The dimension of target CRS.
-
getParameters
Returns the set of parameters.- Specified by:
getParametersin interfaceOperationMethod- Returns:
- The parameters, or an empty group if none.
-
equals
Compare this operation method with the specified object for equality. IfcompareMetadataistrue, then all available properties are compared including formula.- Overrides:
equalsin classAbstractIdentifiedObject- Parameters:
object- The object to compare tothis.compareMetadata-truefor performing a strict comparaison, orfalsefor comparing only properties relevant to transformations.- Returns:
trueif both objects are equal.
-
hashCode
public int hashCode()Returns a hash code value for this operation method.- Overrides:
hashCodein classAbstractIdentifiedObject- Returns:
- The hash code value. This value doesn't need to be the same in past or future versions of this class.
-
formatWKT
Format the inner part of a Well Known Text (WKT) element.- Overrides:
formatWKTin classFormattable- Parameters:
formatter- The formatter to use.- Returns:
- The WKT element name.
- See Also:
-
checkDimensions
public static void checkDimensions(OperationMethod method, MathTransform transform) throws MismatchedDimensionException Checks if an operation method and a math transform have a compatible number of source and target dimensions. In the particular case of a pass through transform with more dimension than the expected number, the check will rather be performed against the sub transform.This convenience method is provided for argument checking.
- Parameters:
method- The operation method to compare to the math transform, ornull.transform- The math transform to compare to the operation method, ornull.- Throws:
MismatchedDimensionException- if the number of dimensions are incompatibles.
-
formatPROJ
Description copied from interface:PROJFormattableFormat the inner part of a PROJFormattable object.This method is automatically invoked by
PROJFormatter.append(PROJFormattable).For example for a element (
DefaultOperationMethod) of type Projection, the formatter will invoke this method to prepend the "+proj=" String for completing the PROJ String before appending the Projection Name (e.g. lcc for a Lambert Conformal Conic)- Specified by:
formatPROJin interfacePROJFormattable- Parameters:
formatter- The PROJFormatter to use.- Returns:
- The proj String of the PROJ element type if any. (e.g. +ellps= for named ellipsoids, +datum= for named datums).
-