osrm

package
v0.0.0-...-5682995 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2021 License: MIT Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL