routing-service/routing.go

28 lines
483 B
Go
Raw Normal View History

2023-03-27 18:57:28 +00:00
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
}