# Class DefaultMathTransformFactory

Object
AbstractFactory
DefaultMathTransformFactory

All Implemented Interfaces:
  `Parser`, `MathTransformFactory`, `Factory`

public class DefaultMathTransformFactory extends AbstractFactory implements MathTransformFactory, Parser
Low level factory for creating math transforms. The objects created by this factory do not know what the source and target coordinate systems mean. Because of this low semantic value, high level GIS applications usually do not need to use this factory directly. They can use the static convenience methods in the `CRS` or `MathTransforms` classes instead.

## Standard parameters

`MathTransform` instances are created from parameter values. The parameters expected by each operation available in a default Apache SIS installation is listed here. The set of parameters varies for each operation or projection, but the following can be considered typical:

- A semi-major and semi-minor axis length in metres.
- A central meridian and latitude of origin in decimal degrees.
- A scale factor, which default to 1.
- A false easting and false northing in metres, which default to 0.

Each descriptor has many aliases, and those aliases may vary between different projections. For example, the false easting parameter is usually called `"false_easting"` by OGC, while EPSG uses various names like False easting or Easting at false origin.

## Dynamic parameters

A few non-standard parameters are defined for compatibility reasons, but delegates their work to standard parameters. Those dynamic parameters are not listed in the parameter values. Dynamic parameters are:

- `"earth_radius"`, which copy its value to the `"semi_major"` and `"semi_minor"` parameter values.
- `"inverse_flattening"`, which compute the `"semi_minor"` value from the `"semi_major"` parameter value.
- `"standard_parallel"` expecting an array of type `double[]`, which copy its elements to the `"standard_parallel_1"` and `"standard_parallel_2"` parameter scalar values.

The main purpose of those dynamic parameters is to support some less commonly used conventions without duplicating the most commonly used conventions. The alternative ways are used in netCDF files for example, which often use spherical models instead of ellipsoidal ones.

## Mandatory and optional parameters

Parameters are flagged as either mandatory or optional. A parameter may be mandatory and still have a default value. In the context of this package, "mandatory" means that the parameter is an essential part of the projection defined by standards. Such mandatory parameters will always appears in any Well Known Text (WKT) formatting, even if not explicitly set by the user. For example, the central meridian is typically a mandatory parameter with a default value of 0° (the Greenwich meridian).

Optional parameters, on the other hand, are often non-standard extensions. They will appear in WKT formatting only if the user defined explicitly a value which is different than the default value.

## Operation methods discovery

`OperationMethod` describes all the parameters expected for instantiating a particular kind of math transform. The set of operation methods known to this factory can be obtained in two ways:

- specified explicitly at construction time, or
- discovered by scanning the module path.

The default way is to scan the module path. See `MathTransformProvider` for indications about how to add custom coordinate operation methods in a default Apache SIS installation.

## Thread safety

This class is safe for multi-thread usage if all referenced `OperationMethod` instances are thread-safe. There is typically only one `MathTransformFactory` instance for the whole application.

Since:
  0.6
See Also:
  - `MathTransformProvider`
  - `AbstractMathTransform`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `DefaultMathTransformFactory​.Context`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Replaced by `builder(String)`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultMathTransformFactory()`
  Creates a new factory which will discover operation methods with a `ServiceLoader`.
  `DefaultMathTransformFactory(Iterable<? extends OperationMethod> methods)`
  Creates a new factory which will use the given operation methods.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `MathTransformBuilder`
  `builder(String method)`
  Returns a builder for a parameterized math transform using the specified operation method.
  `DefaultMathTransformFactory`
  `caching(boolean enabled)`
  Returns a factory for the same transforms as this factory, but with caching potentially disabled.
  `MathTransform`
  `createAffineTransform(Matrix matrix)`
  Creates an affine transform from a matrix.
  `MathTransform`
  `createBaseToDerived(CoordinateReferenceSystem baseCRS, ParameterValueGroup parameters, CoordinateSystem derivedCS)`
  Deprecated.
  Replaced by `builder(String)`.
  `MathTransform`
  `createConcatenatedTransform(MathTransform tr1, MathTransform tr2)`
  Creates a transform by concatenating two existing transforms.
  `MathTransform`
  `createCoordinateSystemChange(CoordinateSystem source, CoordinateSystem target, Ellipsoid ellipsoid)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Replaced by the following pattern:

      var builder = builder("Coordinate system conversion");
      builder.setSourceAxes(source, ellipsoid);
      builder.setTargetAxes(target, ellipsoid);
      return builder.create();

  `MathTransform`
  `createFromWKT(String wkt)`
  Creates a math transform object from a Well Known Text (WKT).
  `MathTransform`
  `createFromXML(String xml)`
  Deprecated.
  `MathTransform`
  `createParameterizedTransform(ParameterValueGroup parameters)`
  Deprecated.
  This constructor is ambiguous when axis directions are parts of the map projection definition as in Transverse Mercator (South Orientated).
  `MathTransform`
  `createParameterizedTransform(ParameterValueGroup parameters, DefaultMathTransformFactory​.Context context)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Replaced by a builder pattern with `builder(String)`.
  `MathTransform`
  `createPassThroughTransform(int firstAffectedCoordinate, MathTransform subTransform, int numTrailingCoordinates)`
  Creates a transform which passes through a subset of coordinates to another transform.
  `Set<OperationMethod>`
  `getAvailableMethods(Class<? extends SingleOperation> type)`
  Returns a set of available methods for coordinate operations of the given type.
  `ParameterValueGroup`
  `getDefaultParameters(String method)`
  Deprecated.
  This way to create parameterized transform is ambiguous.
  `OperationMethod`
  `getLastMethodUsed()`
  Deprecated.
  Replaced by `MathTransformBuilder​.getMethod()`.
  `OperationMethod`
  `getOperationMethod(String identifier)`
  Returns the operation method for the specified name or identifier.
  `static DefaultMathTransformFactory`
  `provider()`
  Returns the default provider of `MathTransform` instances.
  `void`
  `reload()`
  Notifies this factory that the elements provided by the `Iterable<OperationMethod>` may have changed.
  `MathTransform`
  `swapAndScaleAxes(MathTransform parameterized, DefaultMathTransformFactory​.Context context)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Considered internal API because the definition of "normalized" is implementation-dependent.

  ### Methods inherited from class AbstractFactory

  `getVendor, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface Factory

  `getVendor`

- ## Constructor Details

  - ### DefaultMathTransformFactory

    public DefaultMathTransformFactory()
    Creates a new factory which will discover operation methods with a `ServiceLoader`. The `OperationMethod` implementations shall be listed in `module-info​.java` as provider of the `org​.opengis​.referencing​.operation​.OperationMethod` service. `DefaultMathTransformFactory` scans the providers of all modules in order to list all available operation methods. Currently, only operation methods implementing the `MathTransformProvider` interface can be used by the `create(…)` methods in this class.
    See Also:
      - `provider()`
      - `reload()`

  - ### DefaultMathTransformFactory

    public DefaultMathTransformFactory(Iterable<? extends OperationMethod> methods)
    Creates a new factory which will use the given operation methods. The given iterable is stored by reference — its content is not copied — in order to allow deferred `OperationMethod` constructions. Note that by default, only operation methods that implement the `MathTransformProvider` interface can be used by the `create(…)` methods in this class.

    #### Requirements

    - The given iterable should not contain duplicated elements.
    - The given iterable shall be stable: all elements returned by the first iteration must also be returned by any subsequent iterations, unless `reload()` has been invoked.
    - `OperationMethod` instances should also implement `MathTransformProvider`.
    - All `OperationMethod` instances shall be thread-safe.
    - The `Iterable` itself does not need to be thread-safe since all usages will be synchronized as below:

          synchronized (methods) {
              for (OperationMethod method : methods) {
                  // Use the method here.
              }
          }

    Parameters:
      `methods` - the operation methods to use, stored by reference (not copied).

- ## Method Details

  - ### provider

    public static DefaultMathTransformFactory provider()
    Returns the default provider of `MathTransform` instances. This is the factory used by the Apache SIS library when no non-null `MathTransformFactory` has been explicitly specified. This method can be invoked directly, or indirectly through `ServiceLoader​.load(MathTransformFactory​.class)`.
    Returns:
      the default provider of math transforms.
    Since:
      1.4
    See Also:
      - `ServiceLoader`

  - ### caching

    public DefaultMathTransformFactory caching(boolean enabled)
    Returns a factory for the same transforms as this factory, but with caching potentially disabled. By default, `DefaultMathTransformFactory` caches the `MathTransform` instances for sharing existing instances when transforms are created many times with the same set of parameters. However, this caching may be unnecessarily costly when the transforms to create are known to be short lived. This method allows to get a factory better suited for short-lived objects.

    This method does not modify the state of this factory. Instead, different factory instances for the different caching policy are returned.

    Parameters:
      `enabled` - whether caching should be enabled.
    Returns:
      a factory for the given caching policy.
    Since:
      1.1

  - ### getAvailableMethods

    public Set<OperationMethod> getAvailableMethods(Class<? extends SingleOperation> type)
    Returns a set of available methods for coordinate operations of the given type. The `type` argument can be used for filtering the kind of operations described by the returned `OperationMethod`s. The argument is usually (but not restricted to) one of the following types:
    - `Conversion` for coordinate operations described by definitions (including map projections).
    - `Transformation` for coordinate operations described by empirically derived parameters.
    - invalid reference

          org​.opengis​.referencing​.operation​.PointMotionOperation

      for changes due to the motion of the point between two coordinate epochs.
    - `SingleOperation` for all coordinate operations.
    The returned set may conservatively contain more `OperationMethod` elements than requested if this `MathTransformFactory` does not support filtering by the given type.
    Specified by:
      `getAvailableMethods` in interface `MathTransformFactory`
    Parameters:
      `type` - `SingleOperation.class` for fetching all operation methods, `Transformation.class` for operations defined by empirical parameters, etc.
    Returns:
      methods available in this factory for coordinate operations of the given type.
    See Also:
      - `builder(String)`
      - `DefaultOperationMethod​.getOperationType()`

  - ### getOperationMethod

    public OperationMethod getOperationMethod(String identifier) throws NoSuchIdentifierException
    Returns the operation method for the specified name or identifier. The given argument shall be either a method name (e.g. Transverse Mercator) or one of its identifiers (e.g. `"EPSG:9807"`).

    The search is case-insensitive. Comparisons against method names can be heuristic.

    If more than one method match the given identifier, then the first (according iteration order) non-deprecated matching method is returned. If all matching methods are deprecated, the first one is returned.

    Parameters:
      `identifier` - the name or identifier of the operation method to search.
    Returns:
      the coordinate operation method for the given name or identifier.
    Throws:
      `NoSuchIdentifierException` - if there is no operation method registered for the specified identifier.
    See Also:
      - `DefaultCoordinateOperationFactory​.getOperationMethod(String)`

  - ### builder

    public MathTransformBuilder builder(String method) throws NoSuchIdentifierException
    Returns a builder for a parameterized math transform using the specified operation method. The `method` argument should be the name or identifier of an `OperationMethod` instance returned by ``getAvailableMethods`(null)`, with the addition of the following pseudo-methods:
    - "Coordinate system conversion"
    The returned builder allows to specify not only the operation parameter values, but also some contextual information such as the source and target axes. The builder uses these information for:
    1. Inferring the `"semi_major"`, `"semi_minor"`, `"src_semi_major"`, `"src_semi_minor"`, `"tgt_semi_major"` or `"tgt_semi_minor"` parameter values from the `Ellipsoid` associated to the source or target CRS, if these parameters are not explicitly given and if they are relevant for the coordinate operation method.
    2. Concatenating the parameterized transform with any other transforms required for performing units changes and coordinates swapping.
    The builder does not handle change of prime meridian or anything else related to datum. Datum changes have dedicated `OperationMethod`, for example Longitude rotation (EPSG:9601) for changing the prime meridian.
    Upcoming API generalization: the return type of this method may be changed to a new `MathTransform​.Builder` interface in a future Apache SIS version. This is pending GeoAPI 3.1 release, if approved by OGC.
    Parameters:
      `method` - the case insensitive name or identifier of the desired coordinate operation method.
    Returns:
      a builder for a meth transform implementing the formulas identified by the given method.
    Throws:
      `NoSuchIdentifierException` - if there is no supported method for the given name or identifier.
    Since:
      1.5
    See Also:
      - `getAvailableMethods(Class)`

  - ### getDefaultParameters

    @Deprecated(since="1.5") public ParameterValueGroup getDefaultParameters(String method) throws NoSuchIdentifierException
    Deprecated.
    This way to create parameterized transform is ambiguous. Use `builder(String)` instead.
    Returns the default parameter values for a math transform using the given operation method. The `method` argument is the name of any `OperationMethod` instance returned by ``getAvailableMethods`(SingleOperation.class)`. Valid names are listed here.

    This function creates new parameter instances at every call. Parameters are intended to be modified by the user before to be given to the `createParameterizedTransform(…)` method.

    Specified by:
      `getDefaultParameters` in interface `MathTransformFactory`
    Parameters:
      `method` - the case insensitive name of the coordinate operation method to search for.
    Returns:
      a new group of parameter values for the `OperationMethod` identified by the given name.
    Throws:
      `NoSuchIdentifierException` - if there is no method registered for the given name or identifier.
    See Also:
      - `getAvailableMethods(Class)`
      - `createParameterizedTransform(ParameterValueGroup)`
      - `AbstractMathTransform​.getParameterValues()`

  - ### createParameterizedTransform

    @Deprecated(since="1.5") public MathTransform createParameterizedTransform(ParameterValueGroup parameters) throws NoSuchIdentifierException, FactoryException
    Deprecated.
    This constructor is ambiguous when axis directions are parts of the map projection definition as in Transverse Mercator (South Orientated). Use `builder(String)` instead for allowing the implementation to resolve such ambiguities.
    Creates a transform from a group of parameters. The set of expected parameters varies for each operation. The easiest way to provide parameter values is to get an initially empty group for the desired operation by calling `getDefaultParameters(String)`, then to fill the parameter values. Example:

        ParameterValueGroup group = factory.getDefaultParameters("Transverse_Mercator");
        group.parameter("semi_major").setValue(6378137.000);
        group.parameter("semi_minor").setValue(6356752.314);
        MathTransform mt = factory.createParameterizedTransform(group);

    Sometimes the `"semi_major"` and `"semi_minor"` parameter values are not explicitly provided, but rather inferred from the geodetic reference frame of the source Coordinate Reference System.
    Specified by:
      `createParameterizedTransform` in interface `MathTransformFactory`
    Parameters:
      `parameters` - the parameter values. The parameter group name shall be the name of the desired operation method.
    Returns:
      the transform created from the given parameters.
    Throws:
      `NoSuchIdentifierException` - if there is no method for the given parameter group name.
      `FactoryException` - if the object creation failed. This exception is thrown if some required parameter has not been supplied, or has illegal value.
    See Also:
      - `getDefaultParameters(String)`
      - `getAvailableMethods(Class)`
      - `getLastMethodUsed()`
      - `ParameterBuilder​.createGroupForMapProjection(ParameterDescriptor...)`

  - ### createParameterizedTransform

    @Deprecated(since="1.5", forRemoval=true) public MathTransform createParameterizedTransform(ParameterValueGroup parameters, DefaultMathTransformFactory.Context context) throws NoSuchIdentifierException, FactoryException
    Deprecated, for removal: This API element is subject to removal in a future version.
    Replaced by a builder pattern with `builder(String)`.
    Creates a transform from a group of parameters and a context.
    Parameters:
      `parameters` - the parameter values.
      `context` - information about the context, or `null` if none.
    Returns:
      the transform created from the given parameters.
    Throws:
      `NoSuchIdentifierException` - if there is no method for the given parameter group name.
      `FactoryException` - if the object creation failed.

  - ### swapAndScaleAxes

    @Deprecated(since="1.5", forRemoval=true) public MathTransform swapAndScaleAxes(MathTransform parameterized, DefaultMathTransformFactory.Context context) throws FactoryException
    Deprecated, for removal: This API element is subject to removal in a future version.
    Considered internal API because the definition of "normalized" is implementation-dependent.
    Given a transform between normalized spaces, creates a transform taking in account axis directions, units of measurement and longitude rotation. This method concatenates the given parameterized transform with any other transform required for performing units changes and coordinates swapping.

    The given `parameterized` transform shall expect normalized input coordinates and produce normalized output coordinates. See `AxesConvention` for more information about what Apache SIS means by "normalized".

    #### Example

    The most typical examples of transforms with normalized inputs/outputs are normalized map projections expecting (longitude, latitude) inputs in degrees and calculating (x, y) coordinates in metres, both of them with (East, North) axis orientations.

    #### Controlling the normalization process

    Users who need a different normalized space than the default one may find more convenient to override the `Context​.getMatrix(ContextualParameters​.MatrixRole)` method.
    Parameters:
      `parameterized` - a transform for normalized input and output coordinates.
      `context` - source and target coordinate systems in which the transform is going to be used.
    Returns:
      a transform taking in account unit conversions and axis swapping.
    Throws:
      `FactoryException` - if the object creation failed.
    Since:
      0.7
    See Also:
      - `AxesConvention​.NORMALIZED`
      - `DefaultConversion(Map, OperationMethod, MathTransform, ParameterValueGroup)`

  - ### createBaseToDerived

    @Deprecated(since="0.7") public MathTransform createBaseToDerived(CoordinateReferenceSystem baseCRS, ParameterValueGroup parameters, CoordinateSystem derivedCS) throws NoSuchIdentifierException, FactoryException
    Deprecated.
    Replaced by `builder(String)`.
    Creates a transform from a base CRS to a derived CS using the given parameters. If this method needs to set the values of `"semi_major"` and `"semi_minor"` parameters, then it sets those values directly on the given `parameters` instance – not on a clone – for allowing the caller to get back the complete parameter values. However, this method only fills missing values, it never modify existing values.
    Specified by:
      `createBaseToDerived` in interface `MathTransformFactory`
    Parameters:
      `baseCRS` - the source coordinate reference system.
      `parameters` - the parameter values for the transform.
      `derivedCS` - the target coordinate system.
    Returns:
      the parameterized transform from `baseCRS` to `derivedCS`, including unit conversions and axis swapping.
    Throws:
      `NoSuchIdentifierException` - if there is no transform registered for the coordinate operation method.
      `FactoryException` - if the object creation failed. This exception is thrown if some required parameter has not been supplied, or has illegal value.

  - ### createCoordinateSystemChange

    @Deprecated(since="1.5", forRemoval=true) public MathTransform createCoordinateSystemChange(CoordinateSystem source, CoordinateSystem target, Ellipsoid ellipsoid) throws FactoryException
    Deprecated, for removal: This API element is subject to removal in a future version.
    Replaced by the following pattern:

        var builder = builder("Coordinate system conversion");
        builder.setSourceAxes(source, ellipsoid);
        builder.setTargetAxes(target, ellipsoid);
        return builder.create();

    Creates a math transform that represent a change of coordinate system. If exactly one argument is an ellipsoidal coordinate systems, then the `ellipsoid` argument is mandatory. In all other cases (including the case where both coordinate systems are ellipsoidal), the ellipsoid argument is ignored and can be `null`.

    #### Design note

    This method does not accept separated ellipsoid arguments for `source` and `target` because this method should not be used for datum shifts. If the two given coordinate systems are ellipsoidal, then they are assumed to use the same ellipsoid. If different ellipsoids are desired, then a parameterized transform like Molodensky, Geocentric translations, Coordinate Frame Rotation or Position Vector transformation should be used instead.
    Parameters:
      `source` - the source coordinate system.
      `target` - the target coordinate system.
      `ellipsoid` - the ellipsoid of `EllipsoidalCS`, or `null` if none.
    Returns:
      a conversion from the given source to the given target coordinate system.
    Throws:
      `FactoryException` - if the conversion cannot be created.
    Since:
      0.8

  - ### createAffineTransform

    public MathTransform createAffineTransform(Matrix matrix) throws FactoryException
    Creates an affine transform from a matrix. If the transform input dimension is `M`, and output dimension is `N`, then the matrix will have size `[N+1][M+1]`. The +1 in the matrix dimensions allows the matrix to do a shift, as well as a rotation. The `[M][j]` element of the matrix will be the j'th coordinate of the moved origin. The `[i][N]` element of the matrix will be 0 for i less than `M`, and 1 for i equals `M`.
    Specified by:
      `createAffineTransform` in interface `MathTransformFactory`
    Parameters:
      `matrix` - the matrix used to define the affine transform.
    Returns:
      the affine transform.
    Throws:
      `FactoryException` - if the object creation failed.
    See Also:
      - `MathTransforms​.linear(Matrix)`

  - ### createConcatenatedTransform

    public MathTransform createConcatenatedTransform(MathTransform tr1, MathTransform tr2) throws FactoryException
    Creates a transform by concatenating two existing transforms. A concatenated transform acts in the same way as applying two transforms, one after the other.

    The dimension of the output space of the first transform must match the dimension of the input space in the second transform. In order to concatenate more than two transforms, use this constructor repeatedly.

    Specified by:
      `createConcatenatedTransform` in interface `MathTransformFactory`
    Parameters:
      `tr1` - the first transform to apply to points.
      `tr2` - the second transform to apply to points.
    Returns:
      the concatenated transform.
    Throws:
      `FactoryException` - if the object creation failed.
    See Also:
      - `MathTransforms​.concatenate(MathTransform, MathTransform)`

  - ### createPassThroughTransform

    public MathTransform createPassThroughTransform(int firstAffectedCoordinate, MathTransform subTransform, int numTrailingCoordinates) throws FactoryException
    Creates a transform which passes through a subset of coordinates to another transform. This allows transforms to operate on a subset of coordinates. The resulting transform will have the following dimensions:

        int sourceDim = firstAffectedCoordinate + subTransform.getSourceDimensions() + numTrailingCoordinates;
        int targetDim = firstAffectedCoordinate + subTransform.getTargetDimensions() + numTrailingCoordinates;

    #### Example

    Giving (latitude, longitude, height) coordinates, a pass through transform can convert the height values from meters to feet without affecting the (latitude, longitude) values.
    Specified by:
      `createPassThroughTransform` in interface `MathTransformFactory`
    Parameters:
      `firstAffectedCoordinate` - the lowest index of the affected coordinates.
      `subTransform` - transform to use for affected coordinates.
      `numTrailingCoordinates` - number of trailing coordinates to pass through. Affected coordinates will range from `firstAffectedCoordinate` inclusive to `dimTarget-numTrailingCoordinates` exclusive.
    Returns:
      a pass through transform.
    Throws:
      `FactoryException` - if the object creation failed.

  - ### createFromXML

    @Deprecated public MathTransform createFromXML(String xml) throws FactoryException
    Deprecated.
    There is no XML format for math transforms.
    Specified by:
      `createFromXML` in interface `MathTransformFactory`
    Parameters:
      `xml` - math transform encoded in XML format.
    Returns:
      The math transform (never `null`).
    Throws:
      `FactoryException` - if the object creation failed.

  - ### createFromWKT

    public MathTransform createFromWKT(String wkt) throws FactoryException
    Creates a math transform object from a Well Known Text (WKT). If the given text contains non-fatal anomalies (unknown or unsupported WKT elements, inconsistent unit definitions, etc.), warnings may be reported in a logger named `"org​.apache​.sis​.io​.wkt"`.

    Note that the WKT format is not always lossless. A `MathTransform` recreated from WKT may be non-invertible even if the original transform was invertible. For example if an "Affine" operation is defined by a non-square matrix, Apache SIS implementation sometimes has "hidden" information about the inverse matrix but those information are lost at WKT formatting time. A similar "hidden" information lost may also happen with `WraparoundTransform`, also making that transform non-invertible.

    Specified by:
      `createFromWKT` in interface `MathTransformFactory`
    Specified by:
      `createFromWKT` in interface `Parser`
    Parameters:
      `wkt` - math transform encoded in Well-Known Text format.
    Returns:
      the math transform (never `null`).
    Throws:
      `FactoryException` - if the Well-Known Text cannot be parsed, or if the math transform creation failed from some other reason.

  - ### getLastMethodUsed

    @Deprecated(since="1.5") public OperationMethod getLastMethodUsed()
    Deprecated.
    Replaced by `MathTransformBuilder​.getMethod()`.
    Returns the operation method used by the latest call to a `create(…)` constructor in the currently running thread. Returns `null` if not applicable.

    Invoking `getLastMethodUsed()` can be useful after a call to `createParameterizedTransform(…)`.

    Specified by:
      `getLastMethodUsed` in interface `MathTransformFactory`
    Returns:
      the last method used by a `create(…)` constructor, or `null` if unknown of unsupported.
    See Also:
      - `createParameterizedTransform(ParameterValueGroup)`

  - ### reload

    public void reload()
    Notifies this factory that the elements provided by the `Iterable<OperationMethod>` may have changed. This method performs the following steps:
    - Clears all caches.
    - If the `Iterable` given at construction time is an instance of `ServiceLoader`, invokes its `reload()` method.
    This method is useful to sophisticated applications which dynamically make new plug-ins available at runtime, for example following changes of the application module path.
    See Also:
      - `DefaultMathTransformFactory(Iterable)`
      - `ServiceLoader​.reload()`