public interface ToleranceModifier
Modifies the tolerance threshold before to compare a calculated value against its expected value.
When a
TestCase
is run, GeoAPI invoke the adjust(…)
method. The first given argument will be the default tolerance thresholds computed by the
TestCase
being run. Implementation can modify those tolerances in an arbitrary number of dimensions.
Different implementations are available for different cases. For example:
- Allowing a greater tolerance threshold along the vertical axis compared to the horizontal axis.
- In a geographic CRS, ignoring offsets of 360° in longitude.
- In a geographic CRS, ignoring the longitude value if the latitude is at a pole.
- Since:
- 3.1
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ToleranceModifier
Converts λ and φ tolerance values from metres to degrees before comparing geographic coordinates.static final ToleranceModifier
Converts φ and λ tolerance values from metres to degrees before comparing geographic coordinates.static final ToleranceModifier
Converts λ and φ tolerance values from metres to degrees before comparing the result of an reverse projection.static final ToleranceModifier
Converts φ and λ tolerance values from metres to degrees before comparing the result of an reverse projection.static final ToleranceModifier
Makes the tolerance values relative to the coordinate values being compared. -
Method Summary
Modifier and TypeMethodDescriptionvoid
adjust
(double[] tolerances, DirectPosition coordinates, CalculationType mode) Adjusts the tolerance threshold for comparing the given coordinate along each dimensions.
-
Field Details
-
GEOGRAPHIC
Converts λ and φ tolerance values from metres to degrees before comparing geographic coordinates. The tolerance for the longitude (λ) and latitude (φ) coordinate values are converted from metres to degrees using the standard length of one nautical mile (1852.0 metres per minute of angle). Next, the λ tolerance is adjusted according the distance of the φ coordinate value to the pole. In the extreme case where the coordinate to compare is located at a pole, then the tolerance is 360° in longitude values.This modifier assumes that geographic coordinates are expressed in decimal degrees in (longitude, latitude) order, as documented in the parameterized transform contructor.
- See Also:
-
GEOGRAPHIC_φλ
Converts φ and λ tolerance values from metres to degrees before comparing geographic coordinates. This modifier is identical to theGEOGRAPHIC
tolerance modifier, except that φ and λ axes are interchanged. This is the most common modifier used when testingGeographicCRS
instances created from the EPSG geodetic registry.- See Also:
-
PROJECTION
Converts λ and φ tolerance values from metres to degrees before comparing the result of an reverse projection. For forward projections and all other calculations, the tolerance values are left unchanged.The modifier performs the work documented in
GEOGRAPHIC
if and only if theCalculationType
isINVERSE_TRANSFORM
. For all other cases, the modifier does nothing.- See Also:
-
PROJECTION_FROM_φλ
Converts φ and λ tolerance values from metres to degrees before comparing the result of an reverse projection. This modifier is identical to thePROJECTION
tolerance modifier, except that φ and λ axes are interchanged. This is the most common modifier used when testingProjectedCRS
instances created from the EPSG geodetic registry.- See Also:
-
RELATIVE
Makes the tolerance values relative to the coordinate values being compared. For each dimension, this modifier multiplies the tolerance threshold by the coordinate value and ensure that the result is not lower than the original threshold (in order to allow comparisons of values close to zero):tolerance[i] = max(tolerance[i], tolerance[i] × coordinate[i])
-
-
Method Details
-
adjust
Adjusts the tolerance threshold for comparing the given coordinate along each dimensions.- Parameters:
tolerances
- the default tolerance thresholds determined by theTestCase
being run. This array can be modified in-place.coordinates
- the coordinates being compared, in the target CRS.mode
- indicates if the coordinate being compared is the result of a direct or inverse transform, or if strict equality is requested.
-