Search in sources :

Example 1 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 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;
}
Also used : IntersectionMatrix(com.revolsys.geometry.model.IntersectionMatrix)

Example 2 with IntersectionMatrix

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());
}
Also used : IntersectionMatrix(com.revolsys.geometry.model.IntersectionMatrix)

Example 3 with IntersectionMatrix

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));
}
Also used : IntersectionMatrix(com.revolsys.geometry.model.IntersectionMatrix)

Example 4 with IntersectionMatrix

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());
}
Also used : IntersectionMatrix(com.revolsys.geometry.model.IntersectionMatrix)

Example 5 with IntersectionMatrix

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());
}
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