com.vividsolutions.jump.qa.diff
Class BufferGeometryMatcher

java.lang.Object
  extended by com.vividsolutions.jump.qa.diff.BufferGeometryMatcher
All Implemented Interfaces:
DiffGeometryMatcher

public class BufferGeometryMatcher
extends java.lang.Object
implements DiffGeometryMatcher

Matches geometries based on whether each Geometry is contained in the other's buffer. This is equivalent to each geometry being entirely within the distance tolerance of the other.


Field Summary
static double ERROR_TOLERANCE
           
 
Constructor Summary
BufferGeometryMatcher(double tolerance)
           
 
Method Summary
 com.vividsolutions.jts.geom.Geometry getQueryGeometry()
           
 boolean isMatch(com.vividsolutions.jts.geom.Geometry geom)
           
static boolean isMatch(com.vividsolutions.jts.geom.Geometry g1, com.vividsolutions.jts.geom.Geometry g2, double tolerance)
          Computes whether two geometries match under this similarity test.
static double maxOrthogonalDistance(com.vividsolutions.jts.geom.Envelope env1, com.vividsolutions.jts.geom.Envelope env2)
           
 void setQueryGeometry(com.vividsolutions.jts.geom.Geometry geom)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_TOLERANCE

public static final double ERROR_TOLERANCE
See Also:
Constant Field Values
Constructor Detail

BufferGeometryMatcher

public BufferGeometryMatcher(double tolerance)
Method Detail

isMatch

public static boolean isMatch(com.vividsolutions.jts.geom.Geometry g1,
                              com.vividsolutions.jts.geom.Geometry g2,
                              double tolerance)
Computes whether two geometries match under this similarity test. This is not the most efficient way of executing this predicate for multiple geometries.

Parameters:
g1 - a Geometry
g2 - a Geometry
Returns:
true if the geometries match under this comparison operation

maxOrthogonalDistance

public static double maxOrthogonalDistance(com.vividsolutions.jts.geom.Envelope env1,
                                           com.vividsolutions.jts.geom.Envelope env2)

setQueryGeometry

public void setQueryGeometry(com.vividsolutions.jts.geom.Geometry geom)
Specified by:
setQueryGeometry in interface DiffGeometryMatcher

getQueryGeometry

public com.vividsolutions.jts.geom.Geometry getQueryGeometry()
Specified by:
getQueryGeometry in interface DiffGeometryMatcher

isMatch

public boolean isMatch(com.vividsolutions.jts.geom.Geometry geom)
Specified by:
isMatch in interface DiffGeometryMatcher