Validates
Geometry
and related objects from the org.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
Modifier and TypeFieldDescriptiondouble
Small relative tolerance values for comparisons of floating point numbers.Fields inherited from class org.opengis.test.Validator
container, DEFAULT_TOLERANCE, enforceForbiddenAttributes, logger, requireMandatoryAttributes
-
Constructor Summary
ConstructorDescriptionGeometryValidator
(ValidatorContainer container) Creates a new validator instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
validate
(DirectPosition object) Validates the given position.void
Validates the given envelope.
-
Field Details
-
tolerance
-
-
Constructor Details
-
GeometryValidator
Creates a new validator instance.- Parameters:
container
- the set of validators to use for validating other kinds of objects (see field javadoc).
-
-
Method Details
-
validate
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 coordinate values shall be inside the [minimum … maximum] range.
- Lower > upper coordinate 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 coordinates.
- Parameters:
object
- the object to validate, ornull
.
-
validate
Validates the given position. This method ensures that the following hold:- The number of dimension cannot be negative.
- If the position is associated to a CRS, then their number of dimensions must be equal.
- Length of
DirectPosition.getCoordinates()
must be equals to the number of dimensions. - Values of above array must be equals to values returned by
DirectPosition.getCoordinate(int)
. - If the position is associated to a CRS and the axis range meaning is
RangeMeaning.EXACT
, then the coordinate values must be between the minimum and maximum axis value.
- Parameters:
object
- the object to validate, ornull
.
-