use of com.revolsys.geometry.model.IntersectionMatrix in project com.revolsys.open by revolsys.
the class RelateOp method relate.
/**
* Computes the {@link IntersectionMatrix} for the spatial relationship
* between two {@link Geometry}s, using the default (OGC SFS) Boundary Node Rule
*
* @param a a Geometry to test
* @param b a Geometry to test
* @return the IntersectonMatrix for the spatial relationship between the geometries
*/
public static IntersectionMatrix relate(final Geometry a, final Geometry b) {
final RelateOp relOp = new RelateOp(a, b);
final IntersectionMatrix im = relOp.getIntersectionMatrix();
return im;
}
use of com.revolsys.geometry.model.IntersectionMatrix in project com.revolsys.open by revolsys.
the class IntersectionMatrixTest method testToString.
public void testToString() throws Exception {
final IntersectionMatrix i = new IntersectionMatrix();
i.set("012*TF012");
assertEquals("012*TF012", i.toString());
final IntersectionMatrix c = new IntersectionMatrix(i);
assertEquals("012*TF012", c.toString());
}
use of com.revolsys.geometry.model.IntersectionMatrix in project com.revolsys.open by revolsys.
the class IntersectionMatrixTest method testIsOverlaps.
public void testIsOverlaps() {
assertTrue(new IntersectionMatrix("2*2***2**").isOverlaps(P, P));
assertTrue(new IntersectionMatrix("2*2***2**").isOverlaps(A, A));
assertTrue(!new IntersectionMatrix("2*2***2**").isOverlaps(P, A));
assertTrue(!new IntersectionMatrix("2*2***2**").isOverlaps(L, L));
assertTrue(new IntersectionMatrix("1*2***2**").isOverlaps(L, L));
assertTrue(!new IntersectionMatrix("0FFFFFFF2").isOverlaps(P, P));
assertTrue(!new IntersectionMatrix("1FFF0FFF2").isOverlaps(L, L));
assertTrue(!new IntersectionMatrix("2FFF1FFF2").isOverlaps(A, A));
}
use of com.revolsys.geometry.model.IntersectionMatrix in project com.revolsys.open by revolsys.
the class IntersectionMatrixTest method testIsWithin.
public void testIsWithin() {
assertTrue(new IntersectionMatrix("T0F00F000").isWithin());
assertTrue(!new IntersectionMatrix("T00000FF0").isWithin());
}
use of com.revolsys.geometry.model.IntersectionMatrix in project com.revolsys.open by revolsys.
the class IntersectionMatrixTest method testIsDisjoint.
public void testIsDisjoint() {
assertTrue(new IntersectionMatrix("FF*FF****").isDisjoint());
assertTrue(new IntersectionMatrix("FF1FF2T*0").isDisjoint());
assertTrue(!new IntersectionMatrix("*F*FF****").isDisjoint());
}
Aggregations