Package org.opengis.test
Interface ToleranceModifier
-
public interface ToleranceModifier
Modifies the tolerance threshold before to compare a calculated value against its expected value. When aTestCaseis run, GeoAPI performs the following steps:- Scan every
ImplementationDetailson the classpath and invoke theirtolerance(…)method for theMathTransformbeing tested. - For each non-null
ToleranceModifier, invoke theadjust(…)method. The first given argument will be the default tolerance thresholds computed by theTestCasebeing run. Implementation can modify those tolerances in an arbitrary number of dimensions.
- 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
- Scan every
-
-
Field Summary
Fields Modifier and Type Field Description static ToleranceModifierGEOGRAPHICConverts λ and φ tolerance values from metres to degrees before comparing geographic coordinates.static ToleranceModifierGEOGRAPHIC_φλConverts φ and λ tolerance values from metres to degrees before comparing geographic coordinates.static ToleranceModifierPROJECTIONConverts λ and φ tolerance values from metres to degrees before comparing the result of an inverse projection.static ToleranceModifierPROJECTION_FROM_φλConverts φ and λ tolerance values from metres to degrees before comparing the result of an inverse projection.static ToleranceModifierRELATIVEMakes the tolerance values relative to the ordinate values being compared.
-
Method Summary
Modifier and Type Method Description voidadjust(double[] tolerance, DirectPosition coordinate, CalculationType mode)Adjusts the tolerance threshold for comparing the given coordinate along each dimensions.
-
-
-
Field Detail
-
GEOGRAPHIC
static final ToleranceModifier GEOGRAPHIC
Converts λ and φ tolerance values from metres to degrees before comparing geographic coordinates. The tolerance for the longitude (λ) and latitude (φ) ordinate 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 φ ordinate 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:
ToleranceModifiers.geographic(int, int)
-
GEOGRAPHIC_φλ
static final ToleranceModifier GEOGRAPHIC_φλ
Converts φ and λ tolerance values from metres to degrees before comparing geographic coordinates. This modifier is identical to theGEOGRAPHICtolerance modifier, except that φ and λ axes are interchanged. This is the most common modifier used when testingGeographicCRSinstances created from the EPSG database.- See Also:
ToleranceModifiers.geographic(int, int)
-
PROJECTION
static final ToleranceModifier PROJECTION
Converts λ and φ tolerance values from metres to degrees before comparing the result of an inverse projection. For forward projections and all other calculations, the tolerance values are left unchanged.The modifier performs the work documented in
GEOGRAPHICif and only if theCalculationTypeisINVERSE_TRANSFORM. For all other cases, the modifier does nothing.- See Also:
ToleranceModifiers.projection(int, int)
-
PROJECTION_FROM_φλ
static final ToleranceModifier PROJECTION_FROM_φλ
Converts φ and λ tolerance values from metres to degrees before comparing the result of an inverse projection. This modifier is identical to thePROJECTIONtolerance modifier, except that φ and λ axes are interchanged. This is the most common modifier used when testingProjectedCRSinstances created from the EPSG database.- See Also:
ToleranceModifiers.projection(int, int)
-
RELATIVE
static final ToleranceModifier RELATIVE
Makes the tolerance values relative to the ordinate values being compared. For each dimension, this modifier multiplies the tolerance threshold by the ordinate 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] × ordinate[i])
-
-
Method Detail
-
adjust
void adjust(double[] tolerance, DirectPosition coordinate, CalculationType mode)
Adjusts the tolerance threshold for comparing the given coordinate along each dimensions.- Parameters:
tolerance- the default tolerance threshold determined by theTestCasebeing run. This array can be modified in-place.coordinate- the coordinate 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.
-
-