Search in sources :

Example 16 with RobustLineIntersector

use of com.revolsys.geometry.algorithm.RobustLineIntersector in project com.revolsys.open by revolsys.

the class RobustLineIntersectorTest method testCollinear3.

public void testCollinear3() {
    final RobustLineIntersector i = new RobustLineIntersector();
    final Point p1 = new PointDoubleXY(10, 10);
    final Point p2 = new PointDoubleXY(20, 10);
    final Point q1 = new PointDoubleXY(15, 10);
    final Point q2 = new PointDoubleXY(30, 10);
    i.computeIntersectionPoints(p1, p2, q1, q2);
    assertEquals(LineIntersector.COLLINEAR_INTERSECTION, i.getIntersectionCount());
    assertTrue(!i.isProper());
    assertTrue(i.hasIntersection());
}
Also used : RobustLineIntersector(com.revolsys.geometry.algorithm.RobustLineIntersector) Point(com.revolsys.geometry.model.Point) PointDoubleXY(com.revolsys.geometry.model.impl.PointDoubleXY)

Example 17 with RobustLineIntersector

use of com.revolsys.geometry.algorithm.RobustLineIntersector in project com.revolsys.open by revolsys.

the class RobustLineIntersectorTest method testCollinear2.

public void testCollinear2() {
    final RobustLineIntersector i = new RobustLineIntersector();
    final Point p1 = new PointDoubleXY(10, 10);
    final Point p2 = new PointDoubleXY(20, 10);
    final Point q1 = new PointDoubleXY(20, 10);
    final Point q2 = new PointDoubleXY(30, 10);
    i.computeIntersectionPoints(p1, p2, q1, q2);
    assertEquals(LineIntersector.POINT_INTERSECTION, i.getIntersectionCount());
    assertTrue(!i.isProper());
    assertTrue(i.hasIntersection());
}
Also used : RobustLineIntersector(com.revolsys.geometry.algorithm.RobustLineIntersector) Point(com.revolsys.geometry.model.Point) PointDoubleXY(com.revolsys.geometry.model.impl.PointDoubleXY)

Aggregations

RobustLineIntersector (com.revolsys.geometry.algorithm.RobustLineIntersector)17 Point (com.revolsys.geometry.model.Point)10 LineIntersector (com.revolsys.geometry.algorithm.LineIntersector)6 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)5 IntersectionAdder (com.revolsys.geometry.noding.IntersectionAdder)3 MCIndexNoder (com.revolsys.geometry.noding.MCIndexNoder)3 Noder (com.revolsys.geometry.noding.Noder)2 ScaledNoder (com.revolsys.geometry.noding.ScaledNoder)2 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 List (java.util.List)2 NonRobustLineIntersector (com.revolsys.geometry.algorithm.NonRobustLineIntersector)1 GeometryGraph (com.revolsys.geometry.geomgraph.GeometryGraph)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 LineString (com.revolsys.geometry.model.LineString)1