Class FranceGeocentricInterpolation
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.AbstractIdentifiedObject
org.apache.sis.referencing.operation.DefaultOperationMethod
org.apache.sis.internal.referencing.provider.AbstractProvider
org.apache.sis.internal.referencing.provider.GeodeticOperation
org.apache.sis.internal.referencing.provider.FranceGeocentricInterpolation
- All Implemented Interfaces:
Serializable
,Formattable
,MathTransformProvider
,Deprecable
,LenientComparable
,org.opengis.referencing.IdentifiedObject
,org.opengis.referencing.operation.OperationMethod
- Direct Known Subclasses:
MolodenskyInterpolation
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.
- Since:
- 0.7
- Version:
- 1.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final double[]
Accuracies of offset values.private static final String
Name of the default grid file, as mentioned in the NTG_88 document.static final org.opengis.parameter.ParameterDescriptor<Path>
The operation parameter descriptor for the Geocentric translation file parameter value.private static final String
The keyword expected at the beginning of every lines in the header.static final org.opengis.parameter.ParameterDescriptor<Integer>
The operation parameter descriptor for the EPSG code for Interpolation CRS parameter value.(package private) static final org.opengis.parameter.ParameterDescriptorGroup
The group of all parameters expected by this coordinate operation.(package private) static final double
Precision of offset values in the grid file.private static final long
Serial number for inter-operability with different versions.static final org.opengis.parameter.ParameterDescriptor<Integer>
The operation parameter descriptor for the EPSG code for "standard" CT parameter value.static final double
Geocentric translation parameters to use as a first guess before to use the grid in France.static final double
Geocentric translation parameters to use as a first guess before to use the grid in France.static final double
Geocentric translation parameters to use as a first guess before to use the grid in France.Fields inherited from class org.apache.sis.internal.referencing.provider.GeodeticOperation
redimensioned
Fields inherited from class org.apache.sis.internal.referencing.provider.AbstractProvider
sourceCSType, sourceOnEllipsoid, targetCSType, targetOnEllipsoid
Fields inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
Fields inherited from interface org.opengis.referencing.operation.OperationMethod
FORMULA_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a provider.FranceGeocentricInterpolation
(int sourceDimensions, int targetDimensions, org.opengis.parameter.ParameterDescriptorGroup parameters, GeodeticOperation[] redimensioned) Constructs a provider for the given number of dimensions. -
Method Summary
Modifier and TypeMethodDescriptionprivate 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.(package private) 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) Creates the actual math transform.org.opengis.referencing.operation.MathTransform
createMathTransform
(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.parameter.ParameterValueGroup values) Creates a transform from the specified group of parameter values.(package private) static DatumShiftGridFile<javax.measure.quantity.Angle,
javax.measure.quantity.Length> Returns the grid of the given name.inverse()
The inverse ofFranceGeocentricInterpolation
is a different operation.static boolean
isRecognized
(Path file) Returnstrue
if the given path seems to be a grid published by the French mapping agency for France.(package private) static DatumShiftGridFile.Float<javax.measure.quantity.Angle,
javax.measure.quantity.Length> load
(BufferedReader in, Path file) Unconditionally loads the grid for the given file without in-memory compression.Methods inherited from class org.apache.sis.internal.referencing.provider.GeodeticOperation
redimension, variant3D
Methods inherited from class org.apache.sis.internal.referencing.provider.AbstractProvider
addIdentifierAndLegacy, addNameAndLegacy, builder, createLatitude, createLongitude, createMandatoryLatitude, createScale, createShift, createZeroConstant, getOperationType, recoverableException, resolveAmbiguity
Methods inherited from class org.apache.sis.referencing.operation.DefaultOperationMethod
castOrCopy, computeHashCode, equals, formatTo, getFormula, getInterface, getParameters, getSourceDimensions, getTargetDimensions, redimension
Methods inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
TX
public static final double TXGeocentric 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 TYGeocentric 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 TZGeocentric 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 PRECISIONPrecision 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 ofulp((float) max(|TX|, |TY|, |TZ|))
is about 3E-5. Consequently, the value ofPRECISION
should not be lower than 1E-4 (assuming that we want a power of 10).- See Also:
-
ACCURACY
private static final double[] ACCURACYAccuracies 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. -
HEADER
The keyword expected at the beginning of every lines in the header.- See Also:
-
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
The operation parameter descriptor for the Geocentric translation file parameter value.Parameter names EPSG: Geocentric translation file - Default value:
gr3df97a.txt
- Default value:
-
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 - No default value
-
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 - No default value
-
PARAMETERS
static final org.opengis.parameter.ParameterDescriptorGroup PARAMETERSThe group of all parameters expected by this coordinate operation. The only parameter formally defined by EPSG isFILE
. All other parameters have been taken fromMolodensky
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, ornull
.
-
-
Method Details
-
isRecognized
Returnstrue
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
The inverse ofFranceGeocentricInterpolation
is a different operation.- Overrides:
inverse
in classGeodeticOperation
- 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 atInterpolatedGeocentricTransform
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, ornull
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.FactoryExceptionCreates the actual math transform. The default implementation delegates to the static method defined inInterpolatedGeocentricTransform
, but theMolodenskyInterpolation
subclass will rather delegate toInterpolatedMolodenskyTransform
.- 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, ornull
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
-