ors

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package entities contains JSON mapping structures.

Package ors provides access to openrouteservice API.

Index

Constants

View Source
const (
	ProfileDrivingCar      = Profile("driving-car")
	ProfileDrivingHgv      = Profile("driving-hgv")
	ProfileCyclingRegular  = Profile("cycling-regular")
	ProfileCyclingRoad     = Profile("cycling-road")
	ProfileCyclingMountain = Profile("cycling-mountain")
	ProfileCyclingElectric = Profile("cycling-electric")
	ProfileFootWalking     = Profile("foot-walking")
	ProfileFootHiking      = Profile("foot-hiking")
	ProfileWheelchair      = Profile("wheelchair")
	ProfilePublicTransport = Profile("public-transport")
)

Profile values enumeration.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeaturesElement

type FeaturesElement struct {
	Bbox       []float64                  `json:"bbox,omitempty"`
	Type       string                     `json:"type,omitempty"`
	Properties *FeaturesElementProperties `json:"properties,omitempty"`
	Geometry   *FeaturesElementGeometry   `json:"geometry,omitempty"`
}

FeaturesElement structure is generated from "#/definitions/features.element".

type FeaturesElementGeometry

type FeaturesElementGeometry struct {
	Coordinates [][]float64 `json:"coordinates,omitempty"`
	Type        string      `json:"type,omitempty"`
}

FeaturesElementGeometry structure is generated from "#/definitions/features.element.geometry".

type FeaturesElementProperties

type FeaturesElementProperties struct {
	Transfers int64                                      `json:"transfers,omitempty"`
	Fare      int64                                      `json:"fare,omitempty"`
	Segments  []FeaturesElementPropertiesSegmentsElement `json:"segments,omitempty"`
	WayPoints []int64                                    `json:"way_points,omitempty"`
	Summary   *FeaturesElementPropertiesSummary          `json:"summary,omitempty"`
}

FeaturesElementProperties structure is generated from "#/definitions/features.element.properties".

type FeaturesElementPropertiesSegmentsElement

type FeaturesElementPropertiesSegmentsElement struct {
	Distance float64                                                `json:"distance,omitempty"`
	Duration float64                                                `json:"duration,omitempty"`
	Steps    []FeaturesElementPropertiesSegmentsElementStepsElement `json:"steps,omitempty"`
}

FeaturesElementPropertiesSegmentsElement structure is generated from "#/definitions/features.element.properties.segments.element".

type FeaturesElementPropertiesSegmentsElementStepsElement

type FeaturesElementPropertiesSegmentsElementStepsElement struct {
	Distance    float64 `json:"distance,omitempty"`
	Duration    float64 `json:"duration,omitempty"`
	Type        int64   `json:"type,omitempty"`
	Instruction string  `json:"instruction,omitempty"`
	Name        string  `json:"name,omitempty"`
	WayPoints   []int64 `json:"way_points,omitempty"`
	ExitNumber  int64   `json:"exit_number,omitempty"`
}

FeaturesElementPropertiesSegmentsElementStepsElement structure is generated from "#/definitions/features.element.properties.segments.element.steps.element".

type FeaturesElementPropertiesSummary

type FeaturesElementPropertiesSummary struct {
	Distance float64 `json:"distance,omitempty"`
	Duration float64 `json:"duration,omitempty"`
}

FeaturesElementPropertiesSummary structure is generated from "#/definitions/features.element.properties.summary".

type GeoJSON

type GeoJSON struct {
	Type     string            `json:"type,omitempty"`
	Metadata *Metadata         `json:"metadata,omitempty"`
	Bbox     []float64         `json:"bbox,omitempty"`
	Features []FeaturesElement `json:"features,omitempty"`
}

GeoJSON structure is generated from "#".

func GetRoute

func GetRoute(ctx context.Context, profile Profile, points []gpx.Point) (*GeoJSON, error)

GetRoute uses ORS API to get route information.

type Metadata

type Metadata struct {
	Attribution string          `json:"attribution,omitempty"`
	Service     string          `json:"service,omitempty"`
	Timestamp   int64           `json:"timestamp,omitempty"`
	Query       *MetadataQuery  `json:"query,omitempty"`
	Engine      *MetadataEngine `json:"engine,omitempty"`
}

Metadata structure is generated from "#/definitions/metadata".

type MetadataEngine

type MetadataEngine struct {
	Version   string `json:"version,omitempty"`
	BuildDate string `json:"build_date,omitempty"`
	GraphDate string `json:"graph_date,omitempty"`
}

MetadataEngine structure is generated from "#/definitions/metadata.engine".

type MetadataQuery

type MetadataQuery struct {
	Coordinates [][]float64 `json:"coordinates,omitempty"`
	Profile     string      `json:"profile,omitempty"`
	Format      string      `json:"format,omitempty"`
}

MetadataQuery structure is generated from "#/definitions/metadata.query".

type Profile

type Profile string

Profile is an enum type.

Jump to

Keyboard shortcuts

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