Class DefaultOperationMethod
- All Implemented Interfaces:
- Serializable,- Formattable,- Deprecable,- LenientComparable,- IdentifiedObject,- OperationMethod
OperationMethod
 is a kind of metadata: it does not perform any coordinate operation (e.g. map projection) by itself, but
 tells us what is needed in order to perform such operation.
 The most important parts of an OperationMethod are its name and its
 group of parameter descriptors. The parameter descriptors do not contain
 any value, but tell us what are the expected parameters, together with their units of measurement.
- “Latitude of natural origin” in degrees. Default value is 0°.
- “Longitude of natural origin” in degrees. Default value is 0°.
- “Scale factor at natural origin” as a dimensionless number. Default value is 1.
- “False easting” in metres. Default value is 0 m.
- “False northing” in metres. Default value is 0 m.
Departure from the ISO 19111 standard
The following properties are mandatory according ISO 19111, but may be missing under some conditions in Apache SIS:- The formula if it has not been provided to the constructor, or if it cannot be inferred from the given math transform.
- The parameters if the DefaultOperationMethod(MathTransform)constructor cannot infer them.
Relationship with other classes or interfaces
OperationMethod describes parameters without providing any value (except sometimes default values).
 When values have been assigned to parameters, the result is a SingleOperation.
 Note that there is different kinds of SingleOperation depending on the nature and accuracy of the
 coordinate operation. See getOperationType() for more information.
 The interface performing the actual work of taking coordinates in the
 source CRS and calculating the new coordinates in the
 target CRS is MathTransform.
 In order to allow Apache SIS to instantiate those MathTransforms from given parameter values,
 DefaultOperationMethod subclasses should implement the
 MathTransformProvider interface.
Immutability and thread safety
This class is immutable and thread-safe if all properties given to the constructor are also immutable and thread-safe. It is strongly recommended for all subclasses to be thread-safe, especially theMathTransformProvider implementations to be used with
 DefaultMathTransformFactory.- Since:
- 0.5
- See Also:
Defined in the sis-referencing module
- 
Field SummaryFields inherited from class AbstractIdentifiedObjectDEPRECATED_KEY, LOCALE_KEYFields inherited from interface IdentifiedObjectALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEYFields inherited from interface OperationMethodFORMULA_KEY
- 
Constructor SummaryConstructorsModifierConstructorDescriptionDefaultOperationMethod(Map<String, ?> properties, Integer sourceDimensions, Integer targetDimensions, ParameterDescriptorGroup parameters) Deprecated.ISO 19111:2019 removed "source dimensions" and "target dimensions" attributes.DefaultOperationMethod(Map<String, ?> properties, 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.protectedCreates a new operation method with the same values than the specified one.
- 
Method SummaryModifier and TypeMethodDescriptionstatic DefaultOperationMethodcastOrCopy(OperationMethod object) Returns a SIS operation method implementation with the same values than the given arbitrary implementation.protected longInvoked byhashCode()for computing the hash code when first needed.booleanequals(Object object, ComparisonMode mode) Compares this operation method with the specified object for equality.protected StringFormats this operation as a Well Known TextMethod[…]element.Formula(s) or procedure used by this operation method.Class<? extends OperationMethod>Returns the GeoAPI interface implemented by this class.Class<? extends SingleOperation>Returns the base interface of theCoordinateOperationinstances that use this method.Returns the set of parameters.Deprecated.This attribute has been removed from ISO 19111:2019.Deprecated.This attribute has been removed from ISO 19111:2019.redimension(int sourceDimensions, int targetDimensions) Deprecated.ISO 19111:2019 removed source/target dimensions attributes.static OperationMethodredimension(OperationMethod method, int sourceDimensions, int targetDimensions) Deprecated.Not needed anymore since ISO 19111:2019 removed the "source dimensions" and "target dimensions" attributes.Methods inherited from class AbstractIdentifiedObjectcastOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForNameMethods inherited from class FormattableObjectprint, toString, toString, toWKTMethods inherited from class Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface IdentifiedObjectgetAlias, getIdentifiers, getName, getRemarks, toWKT
- 
Constructor Details- 
DefaultOperationMethodConstructs an operation method from a set of properties and a descriptor group. The properties map is given unchanged to the super-class constructor. In addition to the properties documented in the parent constructor, the following properties are understood by this constructor:Recognized properties (non exhaustive list) Property name Value type Returned by "formula" Formula,CitationorCharSequencegetFormula()Defined in parent classes (reminder) "name" IdentifierorStringAbstractIdentifiedObject.getName()"alias" GenericNameorCharSequence(optionally as array)AbstractIdentifiedObject.getAlias()"identifiers" Identifier(optionally as array)AbstractIdentifiedObject.getIdentifiers()"remarks" InternationalStringorStringAbstractIdentifiedObject.getRemarks()- Parameters:
- properties- set of properties. Shall contain at least- "name".
- parameters- description of parameters expected by this operation.
- Since:
- 1.1
 
- 
DefaultOperationMethod@Deprecated public DefaultOperationMethod(Map<String, ?> properties, Integer sourceDimensions, Integer targetDimensions, ParameterDescriptorGroup parameters) Deprecated.ISO 19111:2019 removed "source dimensions" and "target dimensions" attributes.Constructs an operation method for the given number of dimensions. The source and target dimensions may benullif this method can work with any number of dimensions (e.g. Affine Transform).- Parameters:
- properties- set of properties. Shall contain at least- "name".
- sourceDimensions- number of dimensions in the source CRS of this operation method, or- null.
- targetDimensions- number of dimensions in the target CRS of this operation method, or- null.
- parameters- description of parameters expected by this operation.
 
- 
DefaultOperationMethodConvenience constructor that creates an operation method from a math transform. The information provided in the newly created object are approximations, and usually acceptable only as a fallback when no other information are available.- Parameters:
- transform- the math transform to describe.
 
- 
DefaultOperationMethodCreates a new operation method with the same values than the specified one. This copy constructor provides a way to convert an arbitrary implementation into a SIS 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.
- See Also:
 
 
- 
- 
Method Details- 
castOrCopyReturns a SIS operation method implementation with the same values than the given arbitrary implementation. If the given object isnull, thennullis returned. Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged. Otherwise a new SIS implementation is created and initialized to the attribute values of the given object.- Parameters:
- object- the object to get as a SIS implementation, or- nullif none.
- Returns:
- a SIS implementation containing the values of the given object (may be the
         given object itself), or nullif the argument was null.
 
- 
redimension@Deprecated public static OperationMethod redimension(OperationMethod method, int sourceDimensions, int targetDimensions) Deprecated.Not needed anymore since ISO 19111:2019 removed the "source dimensions" and "target dimensions" attributes.Returns an operation method with different dimensions, if we are allowed to change dimensionality. The need to change anOperationMethoddimensionality may occur in two contexts:- When the original method can work with any number of dimensions. Those methods do not know
     in advance the number of dimensions, which is fixed only after the actual MathTransforminstance has been created. Example: Affine conversion.
- When a three-dimensional method can also be used in the two-dimensional case, typically by assuming that the ellipsoidal height is zero everywhere. Example: Molodensky transform.
 redimension(…)implementation performs the following choice:- If the given method is an instance of DefaultOperationMethod, then delegate toredimension(int, int)in order to allow subclasses to defines their own policy. For example, the Molodensky method needs to override.
- Otherwise for each dimension (source and target):
     - If the corresponding dimension of the given method is null, then set that dimension to the given value in a newOperationMethod.
- Otherwise if the given value is not equal to the corresponding dimension
         in the given method, throw an IllegalArgumentException.
 
- If the corresponding dimension of the given method is 
 - Parameters:
- method- the operation method to redimension, or- null.
- sourceDimensions- the desired number of input dimensions.
- targetDimensions- the desired number of output dimensions.
- Returns:
- the redimensioned operation method, or nullif the given method was null, ormethodif no change is needed.
- Throws:
- IllegalArgumentException- if the given dimensions are illegal for the given operation method.
 
- When the original method can work with any number of dimensions. Those methods do not know
     in advance the number of dimensions, which is fixed only after the actual 
- 
redimensionDeprecated.ISO 19111:2019 removed source/target dimensions attributes.Returns this operation method with different dimensions, if we are allowed to change dimensionality. Seeredimension(OperationMethod, int, int)for more information.The default implementation performs the following choice: for each dimension (source and target): - If the corresponding dimension of the given method is null, then set that dimension to the given value in a newOperationMethod.
- Otherwise if the given value is not equal to the corresponding dimension
       in the given method, throw an IllegalArgumentException.
 - Parameters:
- sourceDimensions- the desired number of input dimensions.
- targetDimensions- the desired number of output dimensions.
- Returns:
- the redimensioned operation method, or thisif no change is needed.
- Throws:
- IllegalArgumentException- if the given dimensions are illegal for this operation method.
- Since:
- 0.6
 
- If the corresponding dimension of the given method is 
- 
getInterfaceReturns the GeoAPI interface implemented by this class. The SIS implementation returnsOperationMethod.class.Note for implementers: Subclasses usually do not need to override this information since GeoAPI does not defineOperationMethodsub-interface. Overriding possibility is left mostly for implementers who wish to extend GeoAPI with their own set of interfaces.- Overrides:
- getInterfacein class- AbstractIdentifiedObject
- Returns:
- OperationMethod.classor a user-defined sub-interface.
 
- 
getOperationTypeReturns the base interface of theCoordinateOperationinstances that use this method. The baseCoordinateOperationinterface is usually one of the following subtypes:- Transformationif the coordinate operation has some errors (typically of a few metres) because of the empirical process by which the operation parameters were determined. Those errors do not depend on the floating point precision or the accuracy of the implementation algorithm.
- Conversionif the coordinate operation is theoretically of infinite precision, ignoring the limitations of floating point arithmetic (including rounding errors) and the approximations implied by finite series expansions.
- Projectionif the coordinate operation is a conversion (as defined above) converting geodetic latitudes and longitudes to plane (map) coordinates. This type can optionally be refined with one of the- CylindricalProjection,- ConicProjectionor- PlanarProjectionsubtypes.
 getOperationType()can conservatively return the base type. The default implementation returnsSingleOperation.class, which is the most conservative return value.- Returns:
- interface implemented by all coordinate operations that use this method.
- See Also:
 
- 
getFormulaFormula(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.Departure from the ISO 19111 standard: this property is mandatory according ISO 19111, but optional in Apache SIS.- Specified by:
- getFormulain interface- OperationMethod
- Returns:
- the formula used by this method, or nullif unknown.
- See Also:
 
- 
getSourceDimensionsDeprecated.This attribute has been removed from ISO 19111:2019.Number of dimensions in the source CRS of this operation method. May be null if unknown, as in an Affine Transform.- Specified by:
- getSourceDimensionsin interface- OperationMethod
- Returns:
- the dimension of source CRS, or nullif unknown.
- See Also:
 
- 
getTargetDimensionsDeprecated.This attribute has been removed from ISO 19111:2019.Number of dimensions in the target CRS of this operation method. May be null if unknown, as in an Affine Transform.- Specified by:
- getTargetDimensionsin interface- OperationMethod
- Returns:
- the dimension of target CRS, or nullif unknown.
- See Also:
 
- 
getParametersReturns the set of parameters.Departure from the ISO 19111 standard: this property is mandatory according ISO 19111, but may benullin Apache SIS if theDefaultOperationMethod(MathTransform)constructor has been unable to infer it.- Specified by:
- getParametersin interface- OperationMethod
- Returns:
- the parameters, or nullif unknown.
- See Also:
 
- 
equalsCompares this operation method with the specified object for equality. If themodeargument value isSTRICTorBY_CONTRACT, then all available properties are compared including the formula.- Specified by:
- equalsin interface- LenientComparable
- Overrides:
- equalsin class- AbstractIdentifiedObject
- Parameters:
- object- the object to compare to- this.
- mode-- STRICTfor performing a strict comparison, or- IGNORE_METADATAfor comparing only properties relevant to transformations.
- Returns:
- trueif both objects are equal.
- See Also:
 
- 
computeHashCodeprotected long computeHashCode()Invoked byhashCode()for computing the hash code when first needed. SeeAbstractIdentifiedObject.computeHashCode()for more information.- Overrides:
- computeHashCodein class- AbstractIdentifiedObject
- Returns:
- the hash code value. This value may change in any future Apache SIS version.
 
- 
formatToFormats this operation as a Well Known TextMethod[…]element.- Overrides:
- formatToin class- AbstractIdentifiedObject
- Parameters:
- formatter- the formatter where to format the inner content of this WKT element.
- Returns:
- "Method"(WKT 2) or- "Projection"(WKT 1).
- See Also:
 
 
-