Search code examples
javadictionarygeotools

How to add waypoint item in GeoTools


When looking the examples of the Geotools, i cant find the examples about adding waypoint into Map of GeoTools.

So how can i add the waypoint into Geotools ?


Solution

  • There are a couple of ways to answer your question depending on what you intended:

    A: GeoTools is just a toolkit; it does not provide an interactive map for adding a waypoint. There is no visual tutorial for the gt-graph module showing how to add a waypoint.

    A: The gt-graph module does show how to find the shortest path between 2 (or more) locations; if you consider those locations waypoints you are set.

    //calculate the paths
    for ( Iterator d = destinations.iterator(); d.hasNext(); ) {
      Node destination = (Node) d.next();
      Path path = pf.getPath( destination );
    
      //do something with the path
    }
    

    To see this source code in context the documentation page is here: