Package com.vividsolutions.jts.planargraph

Examples of com.vividsolutions.jts.planargraph.DirectedEdge


    Coordinate[] coordinates = CoordinateArrays.removeRepeatedPoints(lineString.getCoordinates());
    Coordinate startCoordinate = coordinates[0];
    Coordinate endCoordinate = coordinates[coordinates.length - 1];
    Node startNode = getNode(startCoordinate);
    Node endNode = getNode(endCoordinate);
    DirectedEdge directedEdge0 = new LineMergeDirectedEdge(startNode, endNode,
        coordinates[1], true);
    DirectedEdge directedEdge1 = new LineMergeDirectedEdge(endNode, startNode,
        coordinates[coordinates.length - 2], false);
    Edge edge = new LineMergeEdge(lineString);
    edge.setDirectedEdges(directedEdge0, directedEdge1);
    add(edge);
  }
View Full Code Here


   
    Coordinate startCoordinate = coordinates[0];
    Coordinate endCoordinate = coordinates[coordinates.length - 1];
    Node startNode = getNode(startCoordinate);
    Node endNode = getNode(endCoordinate);
    DirectedEdge directedEdge0 = new LineMergeDirectedEdge(startNode, endNode,
        coordinates[1], true);
    DirectedEdge directedEdge1 = new LineMergeDirectedEdge(endNode, startNode,
        coordinates[coordinates.length - 2], false);
    Edge edge = new LineMergeEdge(lineString);
    edge.setDirectedEdges(directedEdge0, directedEdge1);
    add(edge);
  }
View Full Code Here

    assertTrue(! algorithms.isOnLine(new Coordinate(30,10),
          new Coordinate[] {new Coordinate(0,10), new Coordinate(20,10)}));
  }

  public void testDirectedEdgeComparator() {
    DirectedEdge d1 = new DirectedEdge(new Node(new Coordinate(0, 0)),
        new Node(new Coordinate(10, 10)), new Coordinate(10, 10), true);
    DirectedEdge d2 = new DirectedEdge(new Node(new Coordinate(0, 0)),
        new Node(new Coordinate(20, 20)), new Coordinate(20, 20), false);
    assertEquals(0, d2.compareTo(d1));
  }
View Full Code Here

        new Node(new Coordinate(20, 20)), new Coordinate(20, 20), false);
    assertEquals(0, d2.compareTo(d1));
  }

  public void testDirectedEdgeToEdges() {
    DirectedEdge d1 = new DirectedEdge(new Node(new Coordinate(0, 0)),
        new Node(new Coordinate(10, 10)), new Coordinate(10, 10), true);
    DirectedEdge d2 = new DirectedEdge(new Node(new Coordinate(20, 0)),
        new Node(new Coordinate(20, 10)), new Coordinate(20, 10), false);
    List edges = DirectedEdge.toEdges(Arrays.asList(new Object[]{d1, d2}));
    assertEquals(2, edges.size());
    assertNull(edges.get(0));
    assertNull(edges.get(1));
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.planargraph.DirectedEdge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.