valhalla

package module
v0.0.0-...-87743b9 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 11 Imported by: 0

README

Go bindings for Valhalla

These are UNOFFICIAL Go bindings for Valhalla routing engine. The API's are only partially implemented. Please see the examples directory for usage.

PR's are more than welcome

Contact us at hello-team@kamion.io

LittleMonkey Modification

  • Added support for Elevation calls
  • Added some tests (currently 56& coverage) requires the valhalla service to be running on localhost:8002 with tiles covering Oceania as a minimum

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Endpoint string
	// contains filtered or unexported fields
}

func New

func New(endpoint string) *Client

func (*Client) Height

func (c *Client) Height(request ElevationRequest) (ElevationResponse, error)

func (*Client) Isochrone

func (c *Client) Isochrone(request RouteRequest) (*geojson.FeatureCollection, error)

func (*Client) Locate

func (c *Client) Locate(request RouteRequest) (LocateResponse, error)

func (Client) MarshalEasyJSON

func (v Client) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Client) MarshalJSON

func (v Client) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Client) Route

func (c *Client) Route(request RouteRequest) (RouteResponse, error)

func (*Client) RouteOptimized

func (c *Client) RouteOptimized(request RouteRequest) (RouteResponse, error)

func (*Client) Status

func (c *Client) Status() (StatusResponse, error)

func (*Client) TraceAttributes

func (c *Client) TraceAttributes(request TraceAttributesRequest) (TraceAttributesResponse, error)

func (*Client) TraceRoute

func (c *Client) TraceRoute(request TraceRouteRequest) (RouteResponse, error)

func (*Client) UnmarshalEasyJSON

func (v *Client) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Client) UnmarshalJSON

func (v *Client) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Contour

type Contour struct {
	Time  int    `json:"time,omitempty"`
	Color string `json:"color,omitempty"`
}

func (Contour) MarshalEasyJSON

func (v Contour) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Contour) MarshalJSON

func (v Contour) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Contour) UnmarshalEasyJSON

func (v *Contour) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Contour) UnmarshalJSON

func (v *Contour) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CostingOption

type CostingOption struct {
	CountryCrossingPenalty int `json:"country_crossing_penalty,omitempty"`
	TollBoothPenalty       int `json:"toll_booth_penalty,omitempty"`
	CountryCrossingCost    int `json:"country_crossing_cost,omitempty"`

	// truck specific costing options
	Hazmat   bool    `json:"hazmat,omitempty"`
	Weight   float32 `json:"weight,omitempty"`
	AxleLoad float32 `json:"axle_load,omitempty"`
	Height   float32 `json:"height,omitempty"`
	Width    float32 `json:"width,omitempty"`
	Length   float32 `json:"length,omitempty"`
}

func (CostingOption) MarshalEasyJSON

func (v CostingOption) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CostingOption) MarshalJSON

func (v CostingOption) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CostingOption) UnmarshalEasyJSON

func (v *CostingOption) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CostingOption) UnmarshalJSON

func (v *CostingOption) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CostingOptions

type CostingOptions struct {
	Auto  CostingOption `json:"auto,omitempty"`
	Truck CostingOption `json:"truck,omitempty"`
}

func (CostingOptions) MarshalEasyJSON

func (v CostingOptions) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CostingOptions) MarshalJSON

func (v CostingOptions) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CostingOptions) UnmarshalEasyJSON

func (v *CostingOptions) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CostingOptions) UnmarshalJSON

func (v *CostingOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DirectionsOptions

type DirectionsOptions struct {
	Units     string `json:"units,omitempty"`
	Narrative bool   `json:"narrative,omitempty"`
	Language  string `json:"language,omitempty"`
}

func (DirectionsOptions) MarshalEasyJSON

func (v DirectionsOptions) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DirectionsOptions) MarshalJSON

func (v DirectionsOptions) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DirectionsOptions) UnmarshalEasyJSON

func (v *DirectionsOptions) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DirectionsOptions) UnmarshalJSON

func (v *DirectionsOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Edge

type Edge struct {
	Names                []string `json:"names"`
	Length               float64  `json:"length"`
	Speed                float64  `json:"speed"`
	RoadClass            string   `json:"road_class"`
	BeginHeading         float64  `json:"begin_heading"`
	EndHeading           float64  `json:"end_heading"`
	BeginShapeIndex      int      `json:"begin_shape_index"`
	EndShapeIndex        int      `json:"end_shape_index"`
	Traversability       string   `json:"traversability"`
	Use                  string   `json:"use"`
	Toll                 bool     `json:"toll"`
	Unpaved              bool     `json:"unpaved"`
	Tunnel               bool     `json:"tunnel"`
	Bridge               bool     `json:"bridge"`
	Roundabout           bool     `json:"roundabout"`
	InternalIntersection bool     `json:"internal_intersection"`
	DriveOnRight         bool     `json:"drive_on_right"`
	Surface              string   `json:"surface"`
	Sign                 struct {
		ExitNumber []string `json:"exit_number"`
		ExitBranch []string `json:"exit_branch"`
		ExitToward []string `json:"exit_toward"`
		ExitName   []string `json:"exit_name"`
	} `json:"sign"`
	TravelMode       string  `json:"travel_mode"`
	VehicleType      string  `json:"vehicle_type"`
	PedestrianType   string  `json:"pedestrian_type"`
	BicycleType      string  `json:"bicycle_type"`
	TransitType      string  `json:"transit_type"`
	ID               int     `json:"id"`
	WayID            int     `json:"way_id"`
	WeightedGrade    float64 `json:"weighted_grade"`
	MaxUpwardGrade   float64 `json:"max_upward_grade"`
	MaxDownwardGrade float64 `json:"max_downward_grade"`
	MeanElevation    float64 `json:"mean_elevation"`
	LaneCount        int     `json:"lane_count"`
	CycleLane        string  `json:"cycle_lane"`
	BicycleNetwork   int     `json:"bicycle_network"`
	SACScale         int     `json:"sac_scale"`
	Shoulder         bool    `json:"shoulder"`
	Sidewalk         string  `json:"sidewalk"`
	Density          float64 `json:"density"`
	SpeedLimit       float64 `json:"speed_limit"`
	TruckSpeed       float64 `json:"truck_speed"`
	TruckRoute       bool    `json:"truck_route"`
	EndNode          struct {
		IntersectingEdges []struct {
			BeginHeading            float64 `json:"begin_heading"`
			FromEdgeNameConsistency bool    `json:"from_edge_name_consistency"`
			ToEdgeNameConsistency   bool    `json:"to_edge_name_consistency"`
			Driveability            string  `json:"drivability"`
			Cyclability             string  `json:"cyclability"`
			Walkability             string  `json:"walkability"`
			Use                     string  `json:"use"`
			RoadClass               string  `json:"road_class"`
		} `json:"intersecting_edges"`
		ElapsedTime float64 `json:"elapsed_time"`
		AdminIndex  int     `json:"admin_index"`
		Type        string  `json:"type"`
		Fork        bool    `json:"fork"`
		TimeZone    string  `json:"time_zone"`
	} `json:"end_node"`
}

func (Edge) MarshalEasyJSON

func (v Edge) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Edge) MarshalJSON

func (v Edge) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Edge) UnmarshalEasyJSON

func (v *Edge) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Edge) UnmarshalJSON

func (v *Edge) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ElevationPoint

type ElevationPoint struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

func (ElevationPoint) MarshalEasyJSON

func (v ElevationPoint) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ElevationPoint) MarshalJSON

func (v ElevationPoint) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ElevationPoint) UnmarshalEasyJSON

func (v *ElevationPoint) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ElevationPoint) UnmarshalJSON

func (v *ElevationPoint) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ElevationRequest

type ElevationRequest struct {
	HeightPrecision  *int             `json:"height_precision,omitempty"`
	ID               string           `json:"id"`
	Range            bool             `json:"range"`
	ShapeFormat      string           `json:"shape_format,omitempty"`
	EncodedPolyline  string           `json:"encoded_polyline,omitempty"`
	Shape            []ElevationPoint `json:"shape,omitempty"`
	ResampleDistance *int             `json:"resample_distance,omitempty"`
}

func (ElevationRequest) MarshalEasyJSON

func (v ElevationRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ElevationRequest) MarshalJSON

func (v ElevationRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ElevationRequest) UnmarshalEasyJSON

func (v *ElevationRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ElevationRequest) UnmarshalJSON

func (v *ElevationRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ElevationResponse

type ElevationResponse struct {
	EncodedPolyline string           `json:"encoded_polyline"`
	RangeHeight     [][]float64      `json:"range_height"`
	Height          []float64        `json:"height"`
	Shape           []ElevationPoint `json:"shape,omitempty"`
}

func (ElevationResponse) MarshalEasyJSON

func (v ElevationResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ElevationResponse) MarshalJSON

func (v ElevationResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ElevationResponse) UnmarshalEasyJSON

func (v *ElevationResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ElevationResponse) UnmarshalJSON

func (v *ElevationResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type LocateResponse

type LocateResponse []struct {
	InputLon float64 `json:"input_lon"`
	InputLat float64 `json:"input_lat"`
	Nodes    []struct {
		TrafficSignal bool    `json:"traffic_signal"`
		Type          string  `json:"type"`
		Lat           float64 `json:"lat"`
		NodeID        struct {
			ID     int   `json:"id"`
			Value  int64 `json:"value"`
			TileID int   `json:"tile_id"`
			Level  int   `json:"level"`
		} `json:"node_id"`
		Access struct {
			Wheelchair bool `json:"wheelchair"`
			Taxi       bool `json:"taxi"`
			HOV        bool `json:"HOV"`
			Truck      bool `json:"truck"`
			Emergency  bool `json:"emergency"`
			Pedestrian bool `json:"pedestrian"`
			Car        bool `json:"car"`
			Bus        bool `json:"bus"`
			Bicycle    bool `json:"bicycle"`
		} `json:"access"`
		Lon            float64 `json:"lon"`
		EdgeCount      int     `json:"edge_count"`
		Administrative struct {
			TimeZonePosix               string `json:"time_zone_posix"`
			StandardTimeZoneName        string `json:"standard_time_zone_name"`
			Iso31661                    string `json:"iso_3166-1"`
			DaylightSavingsTimeZoneName string `json:"daylight_savings_time_zone_name"`
			Country                     string `json:"country"`
			Iso31662                    string `json:"iso_3166-2"`
			State                       string `json:"state"`
		} `json:"administrative"`
		IntersectionType string `json:"intersection_type"`
		Density          int    `json:"density"`
		LocalEdgeCount   int    `json:"local_edge_count"`
		ModeChange       bool   `json:"mode_change"`
	} `json:"nodes"`
	Edges []struct {
		EdgeID struct {
			ID     int   `json:"id"`
			Value  int64 `json:"value"`
			TileID int   `json:"tile_id"`
			Level  int   `json:"level"`
		} `json:"edge_id"`
		EdgeInfo struct {
			Names []string `json:"names"`
			Shape string   `json:"shape"`
			WayID int      `json:"way_id"`
		} `json:"edge_info"`
		Edge struct {
			Classification struct {
				Link           bool   `json:"link"`
				Internal       bool   `json:"internal"`
				Surface        string `json:"surface"`
				Classification string `json:"classification"`
			} `json:"classification"`
			GeoAttributes struct {
				Curvature     int     `json:"curvature"`
				WeightedGrade float32 `json:"weighted_grade"`
				Length        int     `json:"length"`
			} `json:"geo_attributes"`
			SpeedType   string `json:"speed_type"`
			BikeNetwork struct {
				Mountain bool `json:"mountain"`
				Local    bool `json:"local"`
				Regional bool `json:"regional"`
				National bool `json:"national"`
			} `json:"bike_network"`
			CycleLane     string `json:"cycle_lane"`
			TrafficSignal bool   `json:"traffic_signal"`
			Unreachable   bool   `json:"unreachable"`
			RoundAbout    bool   `json:"round_about"`
			Access        struct {
				Truck      bool `json:"truck"`
				Pedestrian bool `json:"pedestrian"`
				Wheelchair bool `json:"wheelchair"`
				Taxi       bool `json:"taxi"`
				HOV        bool `json:"HOV"`
				Emergency  bool `json:"emergency"`
				Motorcycle bool `json:"motorcycle"`
				Car        bool `json:"car"`
				Moped      bool `json:"moped"`
				Bus        bool `json:"bus"`
				Bicycle    bool `json:"bicycle"`
			} `json:"access"`
			DestinationOnly          bool   `json:"destination_only"`
			CountryCrossing          bool   `json:"country_crossing"`
			Forward                  bool   `json:"forward"`
			Seasonal                 bool   `json:"seasonal"`
			Use                      string `json:"use"`
			DriveOnRight             bool   `json:"drive_on_right"`
			LaneCount                int    `json:"lane_count"`
			TruckRoute               bool   `json:"truck_route"`
			PartOfComplexRestriction bool   `json:"part_of_complex_restriction"`
			StartRestriction         struct {
				Truck      bool `json:"truck"`
				Pedestrian bool `json:"pedestrian"`
				Wheelchair bool `json:"wheelchair"`
				Taxi       bool `json:"taxi"`
				HOV        bool `json:"HOV"`
				Emergency  bool `json:"emergency"`
				Motorcycle bool `json:"motorcycle"`
				Car        bool `json:"car"`
				Moped      bool `json:"moped"`
				Bus        bool `json:"bus"`
				Bicycle    bool `json:"bicycle"`
			} `json:"start_restriction"`
			Toll              bool `json:"toll"`
			HasExitSign       bool `json:"has_exit_sign"`
			AccessRestriction bool `json:"access_restriction"`
			Bridge            bool `json:"bridge"`
			Tunnel            bool `json:"tunnel"`
			SpeedLimit        int  `json:"speed_limit"`
			NotThru           bool `json:"not_thru"`
			EndRestriction    struct {
				Truck      bool `json:"truck"`
				Pedestrian bool `json:"pedestrian"`
				Wheelchair bool `json:"wheelchair"`
				Taxi       bool `json:"taxi"`
				HOV        bool `json:"HOV"`
				Emergency  bool `json:"emergency"`
				Motorcycle bool `json:"motorcycle"`
				Car        bool `json:"car"`
				Moped      bool `json:"moped"`
				Bus        bool `json:"bus"`
				Bicycle    bool `json:"bicycle"`
			} `json:"end_restriction"`
			Speed   int `json:"speed"`
			EndNode struct {
				ID     int   `json:"id"`
				Value  int64 `json:"value"`
				TileID int   `json:"tile_id"`
				Level  int   `json:"level"`
			} `json:"end_node"`
		} `json:"edge"`
		MinimumReachability int           `json:"minimum_reachability"`
		TrafficSegments     []interface{} `json:"traffic_segments"`
		Distance            float64       `json:"distance"`
		PercentAlong        float64       `json:"percent_along"`
		CorrelatedLon       float64       `json:"correlated_lon"`
		SideOfStreet        string        `json:"side_of_street"`
		CorrelatedLat       float64       `json:"correlated_lat"`
	} `json:"edges"`
}

type Location

type Location struct {
	Lat                 float64 `json:"lat,omitempty"`
	Lon                 float64 `json:"lon,omitempty"`
	Street              string  `json:"street,omitempty"`
	Type                string
	Heading             int
	HeadingTolerance    int
	MinimumReachability int
	Radius              int
	RankCandidates      bool
	Name                string
	City                string
	State               string
	PostalCode          string
	Country             string
	Phone               string
	URL                 string
	SideOfStreet        string //left, right
	DateTime            string //2015-12-29T08:00
}

func (Location) MarshalEasyJSON

func (v Location) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Location) MarshalJSON

func (v Location) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Location) UnmarshalEasyJSON

func (v *Location) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Location) UnmarshalJSON

func (v *Location) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Maneuver

type Maneuver struct {
	TravelMode                       string   `json:"travel_mode"`
	BeginShapeIndex                  int      `json:"begin_shape_index"`
	Length                           float64  `json:"length"`
	Time                             float64  `json:"time"`
	Type                             int      `json:"type"`
	EndShapeIndex                    int      `json:"end_shape_index"`
	Instruction                      string   `json:"instruction"`
	VerbalPreTransitionInstruction   string   `json:"verbal_pre_transition_instruction"`
	TravelType                       string   `json:"travel_type"`
	StreetNames                      []string `json:"street_names,omitempty"`
	VerbalTransitionAlertInstruction string   `json:"verbal_transition_alert_instruction,omitempty"`
	VerbalPostTransitionInstruction  string   `json:"verbal_post_transition_instruction,omitempty"`
	Sign                             struct {
		ExitBranchElements []struct {
			Text string `json:"text"`
		} `json:"exit_branch_elements"`
	} `json:"sign,omitempty"`
}

func (Maneuver) MarshalEasyJSON

func (v Maneuver) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Maneuver) MarshalJSON

func (v Maneuver) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Maneuver) UnmarshalEasyJSON

func (v *Maneuver) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Maneuver) UnmarshalJSON

func (v *Maneuver) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type RouteRequest

type RouteRequest struct {
	Locations         []Location        `json:"locations,omitempty"`
	Costing           string            `json:"costing,omitempty"`
	DirectionsOptions DirectionsOptions `json:"directions_options,omitempty"`
	ID                string            `json:"id,omitempty"`
	CostingOptions    CostingOptions    `json:"costing_options,omitempty"`
	AvoidLocations    []Location        `json:"avoid_locations,omitempty"`
	Verbose           bool              `json:"verbose,omitempty"`

	// isochrone request
	Contours   []Contour `json:"contours,omitempty"`
	Polygons   bool      `json:"polygons,omitempty"`
	Denoise    float32   `json:"denoise,omitempty"`
	Generalize float32   `json:"generalize,omitempty"`
}

func (RouteRequest) MarshalEasyJSON

func (v RouteRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (RouteRequest) MarshalJSON

func (v RouteRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*RouteRequest) UnmarshalEasyJSON

func (v *RouteRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*RouteRequest) UnmarshalJSON

func (v *RouteRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type RouteResponse

type RouteResponse struct {
	ID   string `json:"id"`
	Trip struct {
		Language      string `json:"language"`
		Status        int    `json:"status"`
		Units         string `json:"units"`
		StatusMessage string `json:"status_message"`
		Legs          []struct {
			Shape   string `json:"shape"`
			Summary struct {
				MaxLon float64 `json:"max_lon"`
				MaxLat float64 `json:"max_lat"`
				Time   float64 `json:"time"`
				Length float64 `json:"length"`
				MinLat float64 `json:"min_lat"`
				MinLon float64 `json:"min_lon"`
			} `json:"summary"`
			Maneuvers []Maneuver `json:"maneuvers"`
		} `json:"legs"`
		Summary struct {
			MaxLon float64 `json:"max_lon"`
			MaxLat float64 `json:"max_lat"`
			Time   float64 `json:"time"`
			Length float64 `json:"length"`
			MinLat float64 `json:"min_lat"`
			MinLon float64 `json:"min_lon"`
		} `json:"summary"`
		Locations []struct {
			OriginalIndex int     `json:"original_index"`
			Type          string  `json:"type"`
			Lon           float64 `json:"lon"`
			Lat           float64 `json:"lat"`
			SideOfStreet  string  `json:"side_of_street"`
		} `json:"locations"`
	} `json:"trip"`
	Alternates []RouteResponse `json:"alternates"`
}

func (RouteResponse) MarshalEasyJSON

func (v RouteResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (RouteResponse) MarshalJSON

func (v RouteResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*RouteResponse) UnmarshalEasyJSON

func (v *RouteResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*RouteResponse) UnmarshalJSON

func (v *RouteResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type StatusResponse

type StatusResponse struct {
	Version             string `json:"version"`
	TileSetLastModified int    `json:"tileset_last_modified"`
}

func (StatusResponse) MarshalEasyJSON

func (v StatusResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (StatusResponse) MarshalJSON

func (v StatusResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*StatusResponse) UnmarshalEasyJSON

func (v *StatusResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*StatusResponse) UnmarshalJSON

func (v *StatusResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TraceAttributesRequest

type TraceAttributesRequest struct {
	EncodedPolyline string       `json:"encoded_polyline"`
	Costing         string       `json:"costing,omitempty"`
	TraceOptions    TraceOptions `json:"trace_options,omitempty"`
	ShapeMatch      string       `json:"shape_match,omitempty"`
}

func (TraceAttributesRequest) MarshalEasyJSON

func (v TraceAttributesRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TraceAttributesRequest) MarshalJSON

func (v TraceAttributesRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TraceAttributesRequest) UnmarshalEasyJSON

func (v *TraceAttributesRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TraceAttributesRequest) UnmarshalJSON

func (v *TraceAttributesRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TraceAttributesResponse

type TraceAttributesResponse struct {
	Edges           []Edge  `json:"edges"`
	OSMChangeSet    int     `json:"osm_changeset"`
	ConfidenceScore float64 `json:"confidence_score"`
	Shape           string  `json:"shape"`
	Units           string  `json:"units"`
	Admins          []struct {
		StateCode   string `json:"state_code"`
		StateText   string `json:"state_text"`
		CountryText string `json:"country_text"`
		CountryCode string `json:"country_code"`
	} `json:"admins"`
}

func (TraceAttributesResponse) MarshalEasyJSON

func (v TraceAttributesResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TraceAttributesResponse) MarshalJSON

func (v TraceAttributesResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TraceAttributesResponse) UnmarshalEasyJSON

func (v *TraceAttributesResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TraceAttributesResponse) UnmarshalJSON

func (v *TraceAttributesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TraceOptions

type TraceOptions struct {
	SearchRadius          *float64 `json:"search_radius,omitempty"`
	GPSAccuracy           *float64 `json:"gps_accuracy,omitempty"`
	BreakageDistance      *float64 `json:"breakage_distance,omitempty"`
	InterpolationDistance *float64 `json:"interpolation_distance,omitempty"`
	TurnPenaltyFactor     *float64 `json:"turn_penalty_factor,omitempty"`
}

func (TraceOptions) MarshalEasyJSON

func (v TraceOptions) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TraceOptions) MarshalJSON

func (v TraceOptions) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TraceOptions) UnmarshalEasyJSON

func (v *TraceOptions) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TraceOptions) UnmarshalJSON

func (v *TraceOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TraceRouteRequest

type TraceRouteRequest struct {
	BeginTime         *float64          `json:"begin_time,omitempty"`
	Durations         []int64           `json:"durations,omitempty"`
	UseTimestamps     bool              `json:"use_timestamps"`
	Costing           string            `json:"costing,omitempty"`
	DirectionsOptions DirectionsOptions `json:"directions_options,omitempty"`
	TraceOptions      TraceOptions      `json:"trace_options,omitempty"`
	LinearReferences  bool              `json:"linear_references"`
	EncodedPolyline   string            `json:"encoded_polyline"`
	ShapeMatch        string            `json:"shape_match,omitempty"`
}

func (TraceRouteRequest) MarshalEasyJSON

func (v TraceRouteRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TraceRouteRequest) MarshalJSON

func (v TraceRouteRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TraceRouteRequest) UnmarshalEasyJSON

func (v *TraceRouteRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TraceRouteRequest) UnmarshalJSON

func (v *TraceRouteRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ValhallaError

type ValhallaError struct {
	ErrorCode  int    `json:"error_code"`
	Error      string `json:"error"`
	StatusCode int    `json:"status_code"`
	Status     string `json:"status"`
}

func (ValhallaError) MarshalEasyJSON

func (v ValhallaError) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ValhallaError) MarshalJSON

func (v ValhallaError) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ValhallaError) UnmarshalEasyJSON

func (v *ValhallaError) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ValhallaError) UnmarshalJSON

func (v *ValhallaError) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Directories

Path Synopsis
examples
isochrone command
locate command
route command
route_optimized command

Jump to

Keyboard shortcuts

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