Class DefaultOperationMethod

All Implemented Interfaces:
Serializable, Formattable, Deprecable, Lenient­Comparable, Printable, Identified­Object, Operation­Method

public class DefaultOperationMethod extends AbstractIdentifiedObject implements OperationMethod
Describes the algorithm and parameters used to perform a coordinate operation. An Operation­Method 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 Operation­Method 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.

In Apache SIS implementation, the name is the only mandatory property. However, it is recommended to provide also identifiers (e.g. “EPSG:9804” in the following example) because names can sometimes be ambiguous or be spelled in different ways.

Example

An operation method named Mercator (variant A) (EPSG:9804) expects the following parameters:
  • 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:

Relationship with other classes or interfaces

Operation­Method describes parameters without providing any value (except sometimes default values). When values have been assigned to parameters, the result is a Single­Operation. Note that there is different kinds of Single­Operation depending on the nature and accuracy of the coordinate operation. See get­Operation­Type() 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 Math­Transform. In order to allow Apache SIS to instantiate those Math­Transforms from given parameter values, Default­Operation­Method subclasses should implement the Math­Transform­Provider 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 the Math­Transform­Provider implementations to be used with Default­Math­Transform­Factory.
Since:
0.5
See Also:
  • Constructor Details

  • Method Details

    • castOrCopy

      public static DefaultOperationMethod castOrCopy(OperationMethod object)
      Returns a SIS operation method implementation with the same values as the given arbitrary implementation. If the given object is null, then null is 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 null if none.
      Returns:
      a SIS implementation containing the values of the given object (may be the given object itself), or null if the argument was null.
    • getInterface

      public Class<? extends OperationMethod> getInterface()
      Returns the GeoAPI interface implemented by this class. The SIS implementation returns Operation­Method​.class.

      Note for implementers

      Subclasses usually do not need to override this information since GeoAPI does not define Operation­Method sub-interface. Overriding possibility is left mostly for implementers who wish to extend GeoAPI with their own set of interfaces.
      Overrides:
      get­Interface in class Abstract­Identified­Object
      Returns:
      Operation­Method​.class or a user-defined sub-interface.
    • getOperationType

      public Class<? extends SingleOperation> getOperationType()
      Returns the base interface of the Coordinate­Operation instances that use this method. The base Coordinate­Operation interface is usually one of the following subtypes:
      • Conversion if 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.
      • Transformation if 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.
      • invalid reference
        org​.opengis​.referencing​.operation​.Point­Motion­Operation
        if the coordinate operation applies changes due to the motion of points between two coordinate epochs.
      In case of doubt, get­Operation­Type() can conservatively return the base type. The default implementation returns Single­Operation​.class, which is the most conservative return value.
      Returns:
      interface implemented by all coordinate operations that use this method.
      See Also:
    • getFormula

      public Formula 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.

      Departure from the ISO 19111 standard

      This property is mandatory according ISO 19111, but optional in Apache SIS.
      Specified by:
      get­Formula in interface Operation­Method
      Returns:
      the formula used by this method, or null if unknown.
      See Also:
    • getSourceDimensions

      @Deprecated(since="1.1") public Integer getSourceDimensions()
      Deprecated.
      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:
      get­Source­Dimensions in interface Operation­Method
      Returns:
      the dimension of source CRS, or null if unknown.
      See Also:
    • getTargetDimensions

      @Deprecated(since="1.1") public Integer getTargetDimensions()
      Deprecated.
      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:
      get­Target­Dimensions in interface Operation­Method
      Returns:
      the dimension of target CRS, or null if unknown.
      See Also:
    • getParameters

      public ParameterDescriptorGroup getParameters()
      Returns the set of parameters.

      Departure from the ISO 19111 standard

      This property is mandatory according ISO 19111, but may be null in Apache SIS if the Default­Operation­Method(Math­Transform) constructor has been unable to infer it.
      Specified by:
      get­Parameters in interface Operation­Method
      Returns:
      the parameters, or null if unknown.
      See Also:
    • 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 Lenient­Comparable
      Overrides:
      equals in class Abstract­Identified­Object
      Parameters:
      object - the object to compare to this.
      mode - the strictness level of the comparison.
      Returns:
      true if both objects are equal.
      See Also:
    • formatTo

      protected String formatTo(Formatter formatter)
      Formats this operation as a Well Known Text Method[…] element.
      Overrides:
      format­To in class Abstract­Identified­Object
      Parameters:
      formatter - the formatter where to format the inner content of this WKT element.
      Returns:
      "Method" (WKT 2) or "Projection" (WKT 1).
      See Also: