Object
ToleranceModifiers
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
The standard length of one nautical mile, which is 1852.0 metres. -
Method Summary
Modifier and TypeMethodDescriptionstatic ToleranceModifier
concatenate
(ToleranceModifier first, ToleranceModifier second) Returns a concatenation of two existing modifiers.static ToleranceModifier
geographic
(int λDimension, int φDimension) Converts λ and φ tolerance values from metres to degrees before comparing geographic coordinates.static ToleranceModifier
maximum
(ToleranceModifier... modifiers) Returns a modifier which will return the maximal tolerance threshold of all the given modifiers for each dimension.static ToleranceModifier
projection
(int λDimension, int φDimension) Converts λ and φ tolerance values from metres to degrees before comparing the result of an reverse projection.static ToleranceModifier
scale
(Set<CalculationType> types, double... factors) Multiplies tolerance values by the given factors.
-
Field Details
-
NAUTICAL_MILE
The standard length of one nautical mile, which is 1852.0 metres. This is the length of about one minute of arc of latitude along any meridian. This distance is used by geographic tolerance modifiers for converting linear units to angular units.- See Also:
-
-
Method 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.- Parameters:
λDimension
- the dimension of longitude coordinate values (typically 0 or 1).φDimension
- the dimension of latitude coordinate values (typically 0 or 1).- Returns:
- a tolerance modifier suitable for comparing geographic coordinates.
- 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(int, int)
if and only if theCalculationType
isINVERSE_TRANSFORM
. For all other cases, the modifier does nothing.- Parameters:
λDimension
- the dimension of longitude coordinate values (typically 0 or 1).φDimension
- the dimension of latitude coordinate values (typically 0 or 1).- Returns:
- a tolerance modifier suitable for comparing projected coordinates.
- See Also:
-
scale
Multiplies tolerance values by the given factors. For every dimension i, this modifier multipliestolerance[i]
byfactors[i]
.If the tolerance array is longer than the factors array, all extra tolerance values are left unchanged. If the tolerance array is shorter than the factors array, the extra factors values are ignored.
- Parameters:
types
- the calculation types for which to apply the given scale factors.factors
- the factors by which to multiply the tolerance values.- Returns:
- a tolerance modifier that scale the tolerance thresholds, or
null
if the given set or array is empty or all the given scale factors are equals to 1.
-
maximum
Returns a modifier which will return the maximal tolerance threshold of all the given modifiers for each dimension.- Parameters:
modifiers
- the modifiers to iterate over.- Returns:
- a filter for the maximal tolerance threshold of all the given modifiers,
or
null
if the givenmodifiers
array is empty.
-
concatenate
Returns a concatenation of two existing modifiers. The tolerance threshold are first adjusted according the first modifier, then the result is given to the second modifier for an additional adjustment.- Parameters:
first
- the first modifier, ornull
.second
- the second modifier, ornull
.- Returns:
- the concatenation of the two given identifiers, or
null
if both identifiers arenull
.
-