initial commit
This commit is contained in:
27
routing.go
Normal file
27
routing.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package routing
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/paulmach/orb"
|
||||
)
|
||||
|
||||
type RoutingService interface {
|
||||
Route(locations []orb.Point) (route *Route, err error)
|
||||
}
|
||||
|
||||
func NewRoutingService(service_type string, baseUrl string) (RoutingService, error) {
|
||||
if service_type == "valhalla" {
|
||||
return NewValhallaRouting(baseUrl)
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("%s routing service not supported", service_type)
|
||||
}
|
||||
|
||||
type Route struct {
|
||||
Summary RouteSummary
|
||||
}
|
||||
|
||||
type RouteSummary struct {
|
||||
Polyline string
|
||||
}
|
||||
Reference in New Issue
Block a user