Package org.opengis.test.geometry
Class GeometryValidator
-
public class GeometryValidator extends Validator
ValidatesGeometry
and related objects from theorg.opengis.geometry
package.This class is provided for users wanting to override the validation methods. When the default behavior is sufficient, the
Validators
static methods provide a more convenient way to validate various kinds of objects.- Since:
- 2.2
-
-
Field Summary
Fields Modifier and Type Field Description double
tolerance
Small relative tolerance values for comparisons of floating point numbers.-
Fields inherited from class Validator
container, DEFAULT_TOLERANCE, enforceForbiddenAttributes, logger, requireMandatoryAttributes
-
-
Constructor Summary
Constructors Constructor Description GeometryValidator(ValidatorContainer container)
Creates a new validator instance.
-
Method Summary
Modifier and Type Method Description void
validate(DirectPosition object)
Validates the given position.void
validate(Envelope object)
Validates the given envelope.-
Methods inherited from class Validator
conditional, forbidden, mandatory, validate
-
-
-
-
Constructor Detail
-
GeometryValidator
public GeometryValidator(ValidatorContainer container)
Creates a new validator instance.- Parameters:
container
- the set of validators to use for validating other kinds of objects (see field javadoc).
-
-
Method Detail
-
validate
public void validate(Envelope object)
Validates the given envelope. This method performs the following verifications:- Envelope and corners dimension shall be the same.
- Envelope and corners CRS shall be the same, ignoring
null
values. - Lower, upper and median ordinate values shall be inside the [minimum … maximum] range.
- Lower > upper ordinate values are allowed only on axis having wraparound range meaning.
- For the usual lower < upper case, compares the minimum, maximum, median and span values against values computed from the lower and upper ordinates.
- Parameters:
object
- the object to validate, ornull
.
-
validate
public void validate(DirectPosition object)
Validates the given position. This method ensures that the following hold:- The number of dimension can not be negative.
- If the position is associated to a CRS, then their number of dimensions must be equal.
- Length of
DirectPosition.getCoordinate()
must be equals to the number of dimensions. - Values of above array must be equals to values returned by
DirectPosition.getOrdinate(int)
. - If the position is associated to a CRS and the axis range meaning is
RangeMeaning.EXACT
, then the ordinate values must be between the minimum and maximum axis value.
- Parameters:
object
- the object to validate, ornull
.
-
-