Class BufferResultMatcher

  • All Implemented Interfaces:
    ResultMatcher

    public class BufferResultMatcher
    extends java.lang.Object
    implements ResultMatcher
    A ResultMatcher which compares the results of buffer operations for equality, up to the given tolerance. All other operations are delagated to the standard EqualityResultMatcher algorithm.
    • Field Detail

      • MAX_RELATIVE_AREA_DIFFERENCE

        private static final double MAX_RELATIVE_AREA_DIFFERENCE
        See Also:
        Constant Field Values
      • MAX_HAUSDORFF_DISTANCE_FACTOR

        private static final double MAX_HAUSDORFF_DISTANCE_FACTOR
        See Also:
        Constant Field Values
      • MIN_DISTANCE_TOLERANCE

        private static final double MIN_DISTANCE_TOLERANCE
        The minimum distance tolerance which will be used. This is required because densified vertices do no lie precisely on their parent segment.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BufferResultMatcher

        public BufferResultMatcher()
    • Method Detail

      • isMatch

        public boolean isMatch​(Geometry geom,
                               java.lang.String opName,
                               java.lang.Object[] args,
                               Result actualResult,
                               Result expectedResult,
                               double tolerance)
        Tests whether the two results are equal within the given tolerance. The input parameters are not considered.
        Specified by:
        isMatch in interface ResultMatcher
        Parameters:
        geom - the target geometry
        opName - the operation performed
        args - the input arguments to the operation
        actualResult - the actual computed result
        expectedResult - the expected result of the test
        tolerance - the tolerance for the test
        Returns:
        true if the actual and expected results are considered equal
      • isBufferResultMatch

        public boolean isBufferResultMatch​(Geometry actualBuffer,
                                           Geometry expectedBuffer,
                                           double distance)
      • isSymDiffAreaInTolerance

        public boolean isSymDiffAreaInTolerance​(Geometry actualBuffer,
                                                Geometry expectedBuffer)
      • isBoundaryHausdorffDistanceInTolerance

        public boolean isBoundaryHausdorffDistanceInTolerance​(Geometry actualBuffer,
                                                              Geometry expectedBuffer,
                                                              double distance)