Package org.geotools.graph.path

Examples of org.geotools.graph.path.DijkstraShortestPathFinder.calculate()


        };

        List<Edge> edgeList = new ArrayList<Edge>();
        for ( int i = 0; i < list.size() - 1; i++ ) {
            DijkstraShortestPathFinder pf = new DijkstraShortestPathFinder( graph, list.get( i ), weighter );
            pf.calculate();
            Path path = pf.getPath( list.get( i + 1 ) );
            if ( path != null ) {
                edgeList.addAll( path.getEdges() );
            }
        }
View Full Code Here


        // create the path finder
        DijkstraShortestPathFinder pf = new DijkstraShortestPathFinder(
                graph, (Graphable) source, costFunction(), tcostFunction());

        pf.calculate();

        Iterator it1 = graph.getNodes().iterator();

        while (it1.hasNext()) {
            Node d = (Node) it1.next();
View Full Code Here

    Node[] ends = GraphTestUtil.buildNoBifurcations(builder(), nnodes);
    DijkstraShortestPathFinder pfinder = new DijkstraShortestPathFinder(
      builder().getGraph(), ends[0], costFunction()
    );
   
    pfinder.calculate();
    Path p = pfinder.getPath(ends[1]);
   
    int count = 99;
    for (Iterator itr = p.iterator(); itr.hasNext();) {
      Node n = (Node)itr.next();
View Full Code Here

   
    DijkstraShortestPathFinder pfinder = new DijkstraShortestPathFinder(
      builder().getGraph(), ends[0], costFunction()
    );
   
    pfinder.calculate();
    Path p = pfinder.getPath(ends[1]);
   
    assertTrue(p.size() == 2);
    assertTrue(p.get(0) == ends[1]);
    assertTrue(p.get(1) == ends[0]);
View Full Code Here

    Map id2node = (Map)obj[1];
   
    DijkstraShortestPathFinder pfinder = new DijkstraShortestPathFinder(
      builder().getGraph(), root, costFunction()
    );
    pfinder.calculate();
   
    for (Iterator itr = builder().getGraph().getNodes().iterator(); itr.hasNext();) {
      Node node = (Node)itr.next();
      String id = node.getObject().toString();
     
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.