org.geotools.referencing.operation
Class DefaultOperationMethod

java.lang.Object
  extended byorg.geotools.referencing.wkt.Formattable
      extended byorg.geotools.referencing.AbstractIdentifiedObject
          extended byorg.geotools.referencing.operation.DefaultOperationMethod
All Implemented Interfaces:
org.opengis.referencing.IdentifiedObject, org.opengis.referencing.operation.OperationMethod, java.io.Serializable
Direct Known Subclasses:
MathTransformProvider

public class DefaultOperationMethod
extends AbstractIdentifiedObject
implements org.opengis.referencing.operation.OperationMethod

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
Version:
$Id: DefaultOperationMethod.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
DefaultOperation, Serialized Form

Field Summary
protected  int sourceDimensions
          Number of dimensions in the source CRS of this operation method.
protected  int targetDimensions
          Number of dimensions in the target CRS of this operation method.
 
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
DefaultOperationMethod(java.util.Map properties, int sourceDimensions, int targetDimensions, org.opengis.parameter.GeneralParameterDescriptor[] parameters)
          Deprecated. Use the method expecting a parameter group instead.
DefaultOperationMethod(java.util.Map properties, int sourceDimensions, int targetDimensions, org.opengis.parameter.ParameterDescriptorGroup parameters)
          Constructs an operation method from a set of properties and a descriptor group.
DefaultOperationMethod(org.opengis.referencing.operation.MathTransform transform)
          Convenience constructor that creates an operation method from a math transform.
DefaultOperationMethod(org.opengis.referencing.operation.OperationMethod method)
          Constructs a new operation method with the same values than the specified one.
DefaultOperationMethod(org.opengis.referencing.operation.OperationMethod method, int sourceDimensions, int targetDimensions)
          Constructs a new operation method with the same values than the specified one except the dimensions.
 
Method Summary
static void checkDimensions(org.opengis.referencing.operation.OperationMethod method, org.opengis.referencing.operation.MathTransform transform)
          Checks if an operation method and a math transform have a compatible number of source and target dimensions.
 boolean equals(AbstractIdentifiedObject object, boolean compareMetadata)
          Compare this operation method with the specified object for equality.
protected  java.lang.String formatWKT(Formatter formatter)
          Format the inner part of a Well Known Text (WKT) element.
 org.opengis.util.InternationalString getFormula()
          Formula(s) or procedure used by this operation method.
 org.opengis.parameter.ParameterDescriptorGroup getParameters()
          Returns the set of parameters.
 int getSourceDimensions()
          Number of dimensions in the source CRS of this operation method.
 int getTargetDimensions()
          Number of dimensions in the target CRS of this operation method.
 int hashCode()
          Returns a hash code value for this operation method.
 
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
 

Field Detail

sourceDimensions

protected final int sourceDimensions
Number of dimensions in the source CRS of this operation method.


targetDimensions

protected final int targetDimensions
Number of dimensions in the target CRS of this operation method.

Constructor Detail

DefaultOperationMethod

public DefaultOperationMethod(org.opengis.referencing.operation.MathTransform transform)
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

public DefaultOperationMethod(org.opengis.referencing.operation.OperationMethod method)
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.


DefaultOperationMethod

public DefaultOperationMethod(org.opengis.referencing.operation.OperationMethod method,
                              int sourceDimensions,
                              int targetDimensions)
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(java.util.Map properties,
                              int sourceDimensions,
                              int targetDimensions,
                              org.opengis.parameter.GeneralParameterDescriptor[] parameters)
Deprecated. Use the method expecting a parameter group instead.

Constructs an operation method from a set of properties and an array of parameter descriptors. The properties given in argument follow the same rules than for the constructor expecting a parameter group. This convenience constructor build automatically a parameter group using the same properties than the one specified for this operation method.

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, or or an empty array if none.

DefaultOperationMethod

public DefaultOperationMethod(java.util.Map properties,
                              int sourceDimensions,
                              int targetDimensions,
                              org.opengis.parameter.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"   String or InternationalString   getFormula()

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, or if none.
Method Detail

getFormula

public org.opengis.util.InternationalString 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:
getFormula in interface org.opengis.referencing.operation.OperationMethod

getSourceDimensions

public int getSourceDimensions()
Number of dimensions in the source CRS of this operation method.

Specified by:
getSourceDimensions in interface org.opengis.referencing.operation.OperationMethod
Returns:
The dimension of source CRS.

getTargetDimensions

public int getTargetDimensions()
Number of dimensions in the target CRS of this operation method.

Specified by:
getTargetDimensions in interface org.opengis.referencing.operation.OperationMethod

getParameters

public org.opengis.parameter.ParameterDescriptorGroup getParameters()
Returns the set of parameters.

Specified by:
getParameters in interface org.opengis.referencing.operation.OperationMethod

equals

public boolean equals(AbstractIdentifiedObject object,
                      boolean compareMetadata)
Compare this operation method with the specified object for equality. If is , then all available properties are compared including formula.

Overrides:
equals in class AbstractIdentifiedObject
Parameters:
object - The object to compare to .
compareMetadata - for performing a strict comparaison, or for comparing only properties relevant to transformations.
Returns:
if both objects are equal.

hashCode

public int hashCode()
Returns a hash code value for this operation method.

Overrides:
hashCode in class AbstractIdentifiedObject
Returns:
The hash code value. This value doesn't need to be the same in past or future versions of this class.

formatWKT

protected java.lang.String formatWKT(Formatter formatter)
Format the inner part of a Well Known Text (WKT) element.

Overrides:
formatWKT in class Formattable
Parameters:
formatter - The formatter to use.
Returns:
The WKT element name.
See Also:
Formattable.toWKT(), Formattable.toString()

checkDimensions

public static void checkDimensions(org.opengis.referencing.operation.OperationMethod method,
                                   org.opengis.referencing.operation.MathTransform transform)
                            throws org.opengis.spatialschema.geometry.MismatchedDimensionException
Checks if an operation method and a math transform have a compatible number of source and target dimensions. In the special case of a pass through transform, the method's dimensions may be checked against the sub transform's dimensions. This convenience method is provided for argument checking.

Parameters:
method - The operation method to compare to the math transform, or .
transform - The math transform to compare to the operation method, or .
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the number of dimensions are incompatibles.
To Do:
The check for ConcatenatedTransform and PassThroughTransform works only for Geotools implementation.


Copyright © GeoTools. All Rights Reserved.