ors

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineDetails

type EngineDetails struct {
	Version   string    `json:"version"`
	BuildDate time.Time `json:"build_date"`
	GraphDate time.Time `json:"graph_date"`
}

type Metadata

type Metadata struct {
	Attribution string        `json:"attribution"`
	Service     string        `json:"service"`
	Timestamp   int64         `json:"timestamp"`
	Query       Query         `json:"query"`
	Engine      EngineDetails `json:"engine"`
}

type OrsClient

type OrsClient struct {
	// contains filtered or unexported fields
}

func NewOrsClient

func NewOrsClient(opts ...OrsClientOption) OrsClient

func (*OrsClient) DirectionsGeoJSON

func (o *OrsClient) DirectionsGeoJSON(ctx context.Context, profile string, reqBody *OrsDirectionRequest) (*entities.GeoJSON, error)

func (*OrsClient) DirectionsJSON

func (o *OrsClient) DirectionsJSON(ctx context.Context, profile string, reqBody *OrsDirectionRequest) (*OrsResponse, error)

func (*OrsClient) DirectionsRawGpx

func (o *OrsClient) DirectionsRawGpx(ctx context.Context, profile string, reqBody *OrsDirectionRequest) (io.ReadCloser, error)

type OrsClientConfig

type OrsClientConfig struct {
	// contains filtered or unexported fields
}

type OrsClientOption

type OrsClientOption func(*OrsClientConfig)

func WithClient

func WithClient(client *http.Client) OrsClientOption

func WithHostURL

func WithHostURL(hostURL *url.URL) OrsClientOption

type OrsDirectionRequest

type OrsDirectionRequest struct {
	Coordinates [][]float64 `json:"coordinates"`
	Units       string      `json:"units"`
	Language    string      `json:"language"`
}

type OrsResponse

type OrsResponse struct {
	BBox     []float64 `json:"bbox"`
	Routes   []Route   `json:"routes"`
	Metadata Metadata  `json:"metadata"`
}

type Query

type Query struct {
	Coordinates [][]float64 `json:"coordinates"`
	Profile     string      `json:"profile"`
	ProfileName string      `json:"profileName"`
	Format      string      `json:"format"`
}

type Route

type Route struct {
	Summary   Summary   `json:"summary"`
	Segments  []Segment `json:"segments"`
	BBox      []float64 `json:"bbox"`
	Geometry  string    `json:"geometry"`
	WayPoints []int     `json:"way_points"`
}

type Segment

type Segment struct {
	Distance float64 `json:"distance"`
	Duration float64 `json:"duration"`
	Steps    []Step  `json:"steps"`
}

type Step

type Step struct {
	Distance    float64 `json:"distance"`
	Duration    float64 `json:"duration"`
	Type        int     `json:"type"`
	Instruction string  `json:"instruction"`
	Name        string  `json:"name"`
	WayPoints   []int   `json:"way_points"`
}

type Summary

type Summary struct {
	Distance float64 `json:"distance"`
	Duration float64 `json:"duration"`
}

Jump to

Keyboard shortcuts

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