Class GeometryValidator


public class GeometryValidator extends Validator
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.

  • Field Details

    • tolerance

      public double tolerance
      Small relative tolerance values for comparisons of floating point numbers. The default value is 1.0E-6. Implementers can change this value before to run the tests.
  • Constructor Details

    • GeometryValidator

      public GeometryValidator(ValidatorContainer container)
      Creates a new validator instance.
      container - the set of validators to use for validating other kinds of objects (see field javadoc).
  • Method Details

    • 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 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.
      object - the object to validate, or null.
    • validate

      public void validate(DirectPosition object)
      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.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 coordinate values must be between the minimum and maximum axis value.
      object - the object to validate, or null.