Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouteService ¶
func NewRouteService(connection string) model.RouteService
NewRouteService creates a route service and sets the most important settings for connecting to the OSRM server. The connection parameter denotes the address to connect to, i.e. http://localhost:5000/
Types ¶
type RouteService ¶
type RouteService struct {
// contains filtered or unexported fields
}
RouteService is a OSRM client providing methods to query data from an OSRM server.
func (*RouteService) QueryRoute ¶
func (r *RouteService) QueryRoute(coordinates ...model.Coordinate) ([]model.Coordinate, float64, error)
QueryRoute sends a request to the OSRM server, asking for the shortest path to connect the given waypoints the the defined order (no, this is not a TSP here :)). When the request is responded successfully, the shortest path is returned as well as the length of the shortest path. Otherwise, a non-nil error is returned.
Click to show internal directories.
Click to hide internal directories.