Class MathTransformProvider

    • Constructor Detail

      • MathTransformProvider

        public MathTransformProvider​(int sourceDimensions,
                                     int targetDimensions,
                                     ParameterDescriptorGroup parameters)
        Constructs a math transform provider from a set of parameters. The provider identifiers will be the same than the parameter ones.
        Parameters:
        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 (never null).
      • MathTransformProvider

        public MathTransformProvider​(Map<String,​?> properties,
                                     int sourceDimensions,
                                     int targetDimensions,
                                     ParameterDescriptorGroup parameters)
        Constructs a math transform provider from a set of properties. The properties map is given unchanged to the super-class constructor.
        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 (never null).
    • Method Detail

      • getOperationType

        public Class<? extends Operation> getOperationType()
        Returns the operation type. It may be Operation.class, Conversion.class, Projection.class, etc.

        The default implementation returns Operation.class. Subclass should overrides this methods and returns the appropriate OpenGIS interface type (not the implementation type).

        Returns:
        The GeoAPI interface implemented by this operation.
      • createDescriptor

        protected static ParameterDescriptor<Double> createDescriptor​(ReferenceIdentifier[] identifiers,
                                                                      double defaultValue,
                                                                      double minimum,
                                                                      double maximum,
                                                                      Unit<?> unit)
        Constructs a parameter descriptor from a set of alias. The parameter is identified by codes provided by one or more authorities. Common authorities are OGC and EPSG for example.

        The first entry in the identifiers array is both the main name and the identifiers. All others are aliases.

        Parameters:
        identifiers - The parameter identifiers. Most contains at least one entry.
        defaultValue - The default value for the parameter, or Double.NaN if none.
        minimum - The minimum parameter value, or Double.NEGATIVE_INFINITY if none.
        maximum - The maximum parameter value, or Double.POSITIVE_INFINITY if none.
        unit - The unit for default, minimum and maximum values.
        Returns:
        The descriptor for the given identifiers.
      • createDescriptorGroup

        protected static ParameterDescriptorGroup createDescriptorGroup​(ReferenceIdentifier[] identifiers,
                                                                        GeneralParameterDescriptor[] parameters)
        Constructs a parameter group from a set of alias. The parameter group is identified by codes provided by one or more authorities. Common authorities are OGC and EPSG for example.

        Special rules:

        Parameters:
        identifiers - The operation identifiers. Most contains at least one entry.
        parameters - The set of parameters, or null or an empty array if none.
        Returns:
        The descriptor for the given identifiers.
      • toMap

        protected static Map<String,​Object> toMap​(ReferenceIdentifier... identifiers)
        Put the identifiers into a properties map suitable for IdentifiedObject constructor.
      • value

        protected static <T> T value​(ParameterDescriptor<T> param,
                                     ParameterValueGroup group)
                              throws ParameterNotFoundException
        Returns the parameter value for the specified operation parameter. This convenience method is used by subclasses for initializing math transform from a set of parameters.
        Type Parameters:
        T - The type of parameter value.
        Parameters:
        param - The parameter to look for.
        group - The parameter value group to search into.
        Returns:
        The requested parameter value, or null if param is optional and the user didn't provided any value.
        Throws:
        ParameterNotFoundException - if the parameter is not found.
      • stringValue

        protected static String stringValue​(ParameterDescriptor<?> param,
                                            ParameterValueGroup group)
                                     throws ParameterNotFoundException
        Returns the parameter value for the specified operation parameter. This convenience method is used by subclasses for initializing math transform from a set of parameters.
        Parameters:
        param - The parameter to look for.
        group - The parameter value group to search into.
        Returns:
        The requested parameter value, or null if param is optional and the user didn't provided any value.
        Throws:
        ParameterNotFoundException - if the parameter is not found.
      • intValue

        protected static int intValue​(ParameterDescriptor<?> param,
                                      ParameterValueGroup group)
                               throws ParameterNotFoundException
        Returns the parameter value for the specified operation parameter. This convenience method is used by subclasses for initializing math transform from a set of parameters.
        Parameters:
        param - The parameter to look for.
        group - The parameter value group to search into.
        Returns:
        The requested parameter value, or 0 if param is optional and the user didn't provided any value.
        Throws:
        ParameterNotFoundException - if the parameter is not found.
      • doubleValue

        protected static double doubleValue​(ParameterDescriptor<?> param,
                                            ParameterValueGroup group)
                                     throws ParameterNotFoundException
        Returns the parameter value for the specified operation parameter. Values are automatically converted into the standard units specified by the supplied param argument. This convenience method is used by subclasses for initializing math transform from a set of parameters.
        Parameters:
        param - The parameter to look for.
        group - The parameter value group to search into.
        Returns:
        The requested parameter value, or NaN if param is optional and the user didn't provided any value.
        Throws:
        ParameterNotFoundException - if the parameter is not found.