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.

    Since:
    2.2
    • Field Detail

      • tolerance

        public double tolerance
        Small relative tolerance values for comparisons of floating point numbers. The default value is 1.0E-6. Implementors can change this value before to run the tests.
    • 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, or null.
      • 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, or null.