public class Router
extends Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
Router.NavigationDirection |
Class to represent a navigation direction, which consists of 3 attributes:
a direction to go, a way, and the distance to travel for.
|
| Constructor | Description |
|---|---|
Router() |
| Modifier and Type | Method | Description |
|---|---|---|
static List<Router.NavigationDirection> |
routeDirections(GraphDB g,
List<Long> route) |
Create the list of directions corresponding to a route on the graph.
|
static List<Long> |
shortestPath(GraphDB g,
double stlon,
double stlat,
double destlon,
double destlat) |
Return a List of longs representing the shortest path from the node
closest to a start location and the node closest to the destination
location.
|
public static List<Long> shortestPath(GraphDB g, double stlon, double stlat, double destlon, double destlat)
g - The graph to use.stlon - The longitude of the start location.stlat - The latitude of the start location.destlon - The longitude of the destination location.destlat - The latitude of the destination location.public static List<Router.NavigationDirection> routeDirections(GraphDB g, List<Long> route)
g - The graph to use.route - The route to translate into directions. Each element
corresponds to a node from the graph in the route.