org.geotoolkit.referencing.operation
Class DefaultSingleOperation

Object
  extended by FormattableObject
      extended by AbstractIdentifiedObject
          extended by AbstractCoordinateOperation
              extended by DefaultSingleOperation
All Implemented Interfaces:
Serializable, Formattable, LenientComparable, IdentifiedObject, CoordinateOperation, SingleOperation
Direct Known Subclasses:
DefaultConversion, DefaultPassThroughOperation, DefaultTransformation

@Immutable
public class DefaultSingleOperation
extends AbstractCoordinateOperation
implements SingleOperation

A parameterized mathematical operation on coordinates that transforms or converts coordinates to another coordinate reference system. This coordinate operation thus uses an operation method, usually with associated parameter values.

In the Geotk implementation, the parameter values are inferred from the transform. Other implementations may have to override the getParameterValues() method.

This is a single (not concatenated) coordinate operation.

Since:
2.0
Version:
3.18
Author:
Martin Desruisseaux (IRD, Geomatys)
See Also:
Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Field Summary
protected  OperationMethod method
          The operation method.
 
Fields inherited from class AbstractCoordinateOperation
domainOfValidity, EMPTY_ACCURACY_ARRAY, sourceCRS, targetCRS, transform
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Fields inherited from interface CoordinateOperation
COORDINATE_OPERATION_ACCURACY_KEY, DOMAIN_OF_VALIDITY_KEY, OPERATION_VERSION_KEY, SCOPE_KEY
 
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
 
Constructor Summary
DefaultSingleOperation(Map<String,?> properties, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, MathTransform transform, OperationMethod method)
          Constructs an operation from a set of properties.
 
Method Summary
static CoordinateOperation create(Map<String,?> properties, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, MathTransform transform, OperationMethod method, Class<? extends CoordinateOperation> type)
          Returns a coordinate operation of the specified class.
 boolean equals(Object object, ComparisonMode mode)
          Compares this operation method with the specified object for equality.
 String formatWKT(Formatter formatter)
          Formats this operation as a pseudo-WKT format.
 OperationMethod getMethod()
          Returns the operation method.
 ParameterValueGroup getParameterValues()
          Returns the parameter values.
 
Methods inherited from class AbstractCoordinateOperation
computeHashCode, getAccuracy, getAccuracy, getCoordinateOperationAccuracy, getDomainOfValidity, getMathTransform, getOperationVersion, getScope, getSourceCRS, getTargetCRS, getType
 
Methods inherited from class AbstractIdentifiedObject
equals, getAlias, getIdentifier, getIdentifiers, getName, getName, getRemarks, hashCode, nameMatches
 
Methods inherited from class FormattableObject
getDefaultIndentation, print, setDefaultIndentation, toString, toWKT, toWKT, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface CoordinateOperation
getCoordinateOperationAccuracy, getDomainOfValidity, getMathTransform, getOperationVersion, getScope, getSourceCRS, getTargetCRS
 
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
 

Field Detail

method

protected final OperationMethod method
The operation method.

Constructor Detail

DefaultSingleOperation

public DefaultSingleOperation(Map<String,?> properties,
                              CoordinateReferenceSystem sourceCRS,
                              CoordinateReferenceSystem targetCRS,
                              MathTransform transform,
                              OperationMethod method)
Constructs an operation from a set of properties. The properties given in argument follow the same rules than for the super-class constructor.

Parameters:
properties - Set of properties. Should contains at least "name".
sourceCRS - The source CRS.
targetCRS - The target CRS.
transform - Transform from positions in the source CRS to positions in the target CRS.
method - The operation method.
Method Detail

create

public static CoordinateOperation create(Map<String,?> properties,
                                         CoordinateReferenceSystem sourceCRS,
                                         CoordinateReferenceSystem targetCRS,
                                         MathTransform transform,
                                         OperationMethod method,
                                         Class<? extends CoordinateOperation> type)
Returns a coordinate operation of the specified class. This method constructs an instance of Transformation, ConicProjection, CylindricalProjection, PlanarProjection, Projection or Conversion.

Parameters:
properties - Set of properties. Should contains at least "name".
sourceCRS - The source CRS.
targetCRS - The target CRS.
transform - Transform from positions in the source CRS to positions in the target CRS.
method - The operation method, or null.
type - The minimal type as Conversion.class, Projection.class, etc. This method may create an instance of a subclass of type.
Returns:
A new coordinate operation of the given type.
See Also:
create(Map, CoordinateReferenceSystem, CoordinateReferenceSystem, MathTransform, OperationMethod, Class)

getMethod

public OperationMethod getMethod()
Returns the operation method.

Specified by:
getMethod in interface SingleOperation

getParameterValues

public ParameterValueGroup getParameterValues()
                                       throws UnsupportedOperationException
Returns the parameter values. The default implementation infers the parameter values from the transform, if possible.

Specified by:
getParameterValues in interface SingleOperation
Throws:
UnsupportedOperationException - if the parameters values can't be determined for the current math transform implementation.
See Also:
DefaultMathTransformFactory.createParameterizedTransform(ParameterValueGroup), Parameterized.getParameterValues()

equals

public boolean equals(Object object,
                      ComparisonMode mode)
Compares this operation method with the specified object for equality. If the mode argument value is STRICT or BY_CONTRACT, then all available properties are compared including the formula.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class AbstractCoordinateOperation
Parameters:
object - The object to compare to this.
mode - STRICT for performing a strict comparison, or IGNORE_METADATA for comparing only properties relevant to transformations.
Returns:
true if both objects are equal.

formatWKT

public String formatWKT(Formatter formatter)
Formats this operation as a pseudo-WKT format. No WKT format were defined for coordinate operation at the time this method was written. This method may change in any future version until a standard format is found.

Specified by:
formatWKT in interface Formattable
Overrides:
formatWKT in class AbstractCoordinateOperation
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.