Class FranceGeocentricInterpolation

All Implemented Interfaces:
Serializable, Formattable, MathTransformProvider, Deprecable, LenientComparable, org.opengis.referencing.IdentifiedObject, org.opengis.referencing.operation.OperationMethod
Direct Known Subclasses:
MolodenskyInterpolation

public class FranceGeocentricInterpolation extends GeodeticOperation
The provider for "Geocentric translation by Grid Interpolation (IGN)" (EPSG:1087). This method replaces the deprecated "France geocentric interpolation" (ESPG:9655). This operation requires a grid file provided by the French mapping agency.

Source: IGN document NTG_88.pdf, "Grille de paramètres de transformation de coordonnées" at http://www.ign.fr.

In principle, this operation method is designed specifically for the French mapping (e.g. EPSG:1053 "NTF to RGF93 (1)") using the following hard-coded parameters:
  • Source ellipsoid: Clarke 1880
  • Target ellipsoid: RGF93
  • Initial X-axis translation: 168.0 (sign reversed)
  • Initial Y-axis translation: 60.0 (sign reversed)
  • Initial Z-axis translation: -320.0 (sign reversed)
However, the Apache SIS implementation is designed in such a way that this operation method could be used for other areas.
Since:
0.7
Version:
1.3
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serial number for inter-operability with different versions.
      See Also:
    • TX

      public static final double TX
      Geocentric translation parameters to use as a first guess before to use the grid in France. The values of those parameters are specified by the NTG_88 document and apply only for France. If the geocentric interpolation is used for other area, other parameter values will be needed.

      The values used by SIS are from source (RGF93) to target (NTF). This is the opposite of the direction defined in NTG_88. Consequently, the signs need to be the opposite of NTG_88 values.

      See Also:
    • TY

      public static final double TY
      Geocentric translation parameters to use as a first guess before to use the grid in France. The values of those parameters are specified by the NTG_88 document and apply only for France. If the geocentric interpolation is used for other area, other parameter values will be needed.

      The values used by SIS are from source (RGF93) to target (NTF). This is the opposite of the direction defined in NTG_88. Consequently, the signs need to be the opposite of NTG_88 values.

      See Also:
    • TZ

      public static final double TZ
      Geocentric translation parameters to use as a first guess before to use the grid in France. The values of those parameters are specified by the NTG_88 document and apply only for France. If the geocentric interpolation is used for other area, other parameter values will be needed.

      The values used by SIS are from source (RGF93) to target (NTF). This is the opposite of the direction defined in NTG_88. Consequently, the signs need to be the opposite of NTG_88 values.

      See Also:
    • PRECISION

      static final double PRECISION
      Precision of offset values in the grid file. The "GR3DF97A.txt" file uses a precision of 0.001. But we define here one more digit in case a user gives a more accurate grid. Note that value of ulp((float) max(|TX|, |TY|, |TZ|)) is about 3E-5. Consequently, the value of PRECISION should not be lower than 1E-4 (assuming that we want a power of 10).
      See Also:
    • ACCURACY

      private static final double[] ACCURACY
      Accuracies of offset values. Accuracies in GR3D files are defined by standard-deviations rounded to integer values. The mapping given in NTG_88 document is: 01 = 5 cm, 02 = 10 cm, 03 = 20 cm, 04 = 50 cm and 99 > 1 m.
    • DEFAULT

      private static final String DEFAULT
      Name of the default grid file, as mentioned in the NTG_88 document. We use the 5 first characters ("gr3df") as a sentinel value for French grid file.
      See Also:
    • FILE

      public static final org.opengis.parameter.ParameterDescriptor<Path> FILE
      The operation parameter descriptor for the Geocentric translation file parameter value.
      Parameter names
      EPSG: Geocentric translation file
      Notes:
      • Default value: gr3df97a.txt
    • INTERPOLATION_CRS

      public static final org.opengis.parameter.ParameterDescriptor<Integer> INTERPOLATION_CRS
      The operation parameter descriptor for the EPSG code for Interpolation CRS parameter value.
      Parameter names
      EPSG: EPSG code for Interpolation CRS
      EPSG: Interpolation CRS code
      Notes:
      • No default value
    • STANDARD_CT

      public static final org.opengis.parameter.ParameterDescriptor<Integer> STANDARD_CT
      The operation parameter descriptor for the EPSG code for "standard" CT parameter value.
      Parameter names
      EPSG: EPSG code for "standard" CT
      EPSG: Standard CT code
      Notes:
      • No default value
    • PARAMETERS

      static final org.opengis.parameter.ParameterDescriptorGroup PARAMETERS
      The group of all parameters expected by this coordinate operation. The only parameter formally defined by EPSG is FILE. All other parameters have been taken from Molodensky since geocentric interpolations can be though as a Molodensky operations with non-constant (ΔX, ΔY, ΔZ) geocentric translation terms.
  • Constructor Details

    • FranceGeocentricInterpolation

      public FranceGeocentricInterpolation()
      Constructs a provider.
    • FranceGeocentricInterpolation

      FranceGeocentricInterpolation(int sourceDimensions, int targetDimensions, org.opengis.parameter.ParameterDescriptorGroup parameters, GeodeticOperation[] redimensioned)
      Constructs a provider for the given number of dimensions.
      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 - description of parameters expected by this operation.
      redimensioned - providers for all combinations between 2D and 3D cases, or null.
  • Method Details

    • isRecognized

      public static boolean isRecognized(Path file)
      Returns true if the given path seems to be a grid published by the French mapping agency for France. In principle this "France geocentric interpolation" is designed specifically for use with the "gr3df97a.txt" grid, but in fact the Apache SIS implementation should be flexible enough for use with other area.
      Parameters:
      file - the grid file.
      Returns:
      true if the given file looks like a fie from the French mapping agency.
    • inverse

      public AbstractProvider inverse()
      The inverse of FranceGeocentricInterpolation is a different operation.
      Overrides:
      inverse in class GeodeticOperation
      Returns:
      null.
      See Also:
    • createEllipsoid

      private static org.opengis.referencing.datum.Ellipsoid createEllipsoid(Parameters values, org.opengis.parameter.ParameterDescriptor<Double> semiMajor, org.opengis.parameter.ParameterDescriptor<Double> semiMinor, org.opengis.referencing.datum.Ellipsoid candidate)
      Creates the source or the target ellipsoid. This is a temporary ellipsoid used only at InterpolatedGeocentricTransform time, then discarded.
      Parameters:
      values - the parameter group from which to get the axis lengths.
      semiMajor - the descriptor for locating the semi-major axis parameter.
      semiMinor - the descriptor for locating the semi-minor axis parameter.
      candidate - an ellipsoid to return if the axis lengths match the lengths found in the parameters, or null if none. The intent is to use the predefined "GRS 1980" ellipsoid if we can, because that ellipsoid is defined by inverse flattening factor instead of by semi-minor axis length.
      Returns:
      a temporary ellipsoid encapsulating the axis lengths found in the parameters.
    • createMathTransform

      public org.opengis.referencing.operation.MathTransform createMathTransform(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.parameter.ParameterValueGroup values) throws org.opengis.parameter.ParameterNotFoundException, org.opengis.util.FactoryException
      Creates a transform from the specified group of parameter values. This method creates the transform from target to source (which is the direction that use the interpolation grid directly without iteration), then inverts the transform.
      Parameters:
      factory - the factory to use if this constructor needs to create other math transforms.
      values - the group of parameter values.
      Returns:
      the created math transform.
      Throws:
      org.opengis.parameter.ParameterNotFoundException - if a required parameter was not found.
      org.opengis.util.FactoryException - if an error occurred while loading the grid.
    • createGeodeticTransformation

      org.opengis.referencing.operation.MathTransform createGeodeticTransformation(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.referencing.datum.Ellipsoid source, org.opengis.referencing.datum.Ellipsoid target, boolean withHeights, DatumShiftGridFile<javax.measure.quantity.Angle,javax.measure.quantity.Length> grid) throws org.opengis.util.FactoryException
      Creates the actual math transform. The default implementation delegates to the static method defined in InterpolatedGeocentricTransform, but the MolodenskyInterpolation subclass will rather delegate to InterpolatedMolodenskyTransform.
      Throws:
      org.opengis.util.FactoryException
    • getOrLoad

      static DatumShiftGridFile<javax.measure.quantity.Angle,javax.measure.quantity.Length> getOrLoad(Path file, double[] averages, double scale) throws org.opengis.util.FactoryException
      Returns the grid of the given name. This method returns the cached instance if it still exists, or load the grid otherwise.
      Parameters:
      file - name of the datum shift grid file to load.
      averages - an "average" value for the offset in each dimension, or null if unknown.
      scale - the factor by which to multiply each compressed value before to add to the average value.
      Throws:
      org.opengis.util.FactoryException
    • load

      static DatumShiftGridFile.Float<javax.measure.quantity.Angle,javax.measure.quantity.Length> load(BufferedReader in, Path file) throws IOException, org.opengis.util.FactoryException, org.opengis.referencing.operation.NoninvertibleTransformException
      Unconditionally loads the grid for the given file without in-memory compression.
      Parameters:
      in - reader of the RGF93 datum shift file.
      file - path to the file being read, used for parameter declaration and error reporting.
      Throws:
      IOException - if an I/O error occurred.
      NumberFormatException - if a number cannot be parsed.
      NoSuchElementException - if a data line is missing a value.
      org.opengis.util.FactoryException - if an problem is found with the file content.
      ArithmeticException - if the width or the height exceed the integer capacity.
      org.opengis.referencing.operation.NoninvertibleTransformException