Search in sources :

Example 11 with IntersectionMatrix

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 a specified Boundary Node Rule.
 *
 * @param a a Geometry to test
 * @param b a Geometry to test
 * @param boundaryNodeRule the Boundary Node Rule to use
 * @return the IntersectonMatrix for the spatial relationship between the input geometries
 */
public static IntersectionMatrix relate(final Geometry a, final Geometry b, final BoundaryNodeRule boundaryNodeRule) {
    final RelateOp relOp = new RelateOp(a, b, boundaryNodeRule);
    final IntersectionMatrix im = relOp.getIntersectionMatrix();
    return im;
}
Also used : IntersectionMatrix(com.revolsys.geometry.model.IntersectionMatrix)

Example 12 with IntersectionMatrix

use of com.revolsys.geometry.model.IntersectionMatrix in project com.revolsys.open by revolsys.

the class IntersectionMatrixTest method testIsEquals.

public void testIsEquals() {
    assertTrue(new IntersectionMatrix("0FFFFFFF2").isEquals(P, P));
    assertTrue(new IntersectionMatrix("1FFF0FFF2").isEquals(L, L));
    assertTrue(new IntersectionMatrix("2FFF1FFF2").isEquals(A, A));
    assertTrue(!new IntersectionMatrix("0F0FFFFF2").isEquals(P, P));
    assertTrue(new IntersectionMatrix("1FFF1FFF2").isEquals(L, L));
    assertTrue(!new IntersectionMatrix("2FFF1*FF2").isEquals(A, A));
    assertTrue(!new IntersectionMatrix("0FFFFFFF2").isEquals(P, L));
    assertTrue(!new IntersectionMatrix("1FFF0FFF2").isEquals(L, A));
    assertTrue(!new IntersectionMatrix("2FFF1FFF2").isEquals(A, P));
}
Also used : IntersectionMatrix(com.revolsys.geometry.model.IntersectionMatrix)

Example 13 with IntersectionMatrix

use of com.revolsys.geometry.model.IntersectionMatrix in project com.revolsys.open by revolsys.

the class IntersectionMatrixTest method testIsCrosses.

public void testIsCrosses() {
    assertTrue(new IntersectionMatrix("TFTFFFFFF").isCrosses(P, L));
    assertTrue(!new IntersectionMatrix("TFTFFFFFF").isCrosses(L, P));
    assertTrue(!new IntersectionMatrix("TFFFFFTFF").isCrosses(P, L));
    assertTrue(new IntersectionMatrix("TFFFFFTFF").isCrosses(L, P));
    assertTrue(new IntersectionMatrix("0FFFFFFFF").isCrosses(L, L));
    assertTrue(!new IntersectionMatrix("1FFFFFFFF").isCrosses(L, L));
}
Also used : IntersectionMatrix(com.revolsys.geometry.model.IntersectionMatrix)

Example 14 with IntersectionMatrix

use of com.revolsys.geometry.model.IntersectionMatrix in project com.revolsys.open by revolsys.

the class IntersectionMatrixTest method testIsIntersects.

public void testIsIntersects() {
    assertTrue(!new IntersectionMatrix("FF*FF****").isIntersects());
    assertTrue(!new IntersectionMatrix("FF1FF2T*0").isIntersects());
    assertTrue(new IntersectionMatrix("*F*FF****").isIntersects());
}
Also used : IntersectionMatrix(com.revolsys.geometry.model.IntersectionMatrix)

Example 15 with IntersectionMatrix

use of com.revolsys.geometry.model.IntersectionMatrix in project com.revolsys.open by revolsys.

the class IntersectionMatrixTest method testIsContains.

public void testIsContains() {
    assertTrue(!new IntersectionMatrix("T0F00F000").isContains());
    assertTrue(new IntersectionMatrix("T00000FF0").isContains());
}
Also used : IntersectionMatrix(com.revolsys.geometry.model.IntersectionMatrix)

Aggregations

IntersectionMatrix (com.revolsys.geometry.model.IntersectionMatrix)17 Geometry (com.revolsys.geometry.model.Geometry)2 LineString (com.revolsys.geometry.model.LineString)2 EdgeEnd (com.revolsys.geometry.geomgraph.EdgeEnd)1 SegmentIntersector (com.revolsys.geometry.geomgraph.index.SegmentIntersector)1 BoundingBox (com.revolsys.geometry.model.BoundingBox)1