Documentation
¶
Index ¶
- Variables
- func ParseOSMSpeedToKM(str string) (int, bool)
- type DistanceClient
- func (c *DistanceClient) Delete()
- func (c DistanceClient) Distance(from []float32, to []float32) uint32
- func (c DistanceClient) Distances(source []float32, targets [][]float32) []uint32
- func (c DistanceClient) Matrix(sources [][]float32, targets [][]float32) [][]uint32
- func (c DistanceClient) Nearest(point []float32) ([]float32, bool)
- func (c DistanceClient) Route(from []float32, to []float32) (uint32, [][]float32)
- func (c *DistanceClient) SetSnapRadius(n float32)
- type Profile
- type SpeedMapper
- type TagMapFilter
- type TransportMode
- type TravelTimeClient
- func (c TravelTimeClient) Matrix(sources [][]float32, targets [][]float32) [][]uint32
- func (c TravelTimeClient) Nearest(point []float32) ([]float32, bool)
- func (c TravelTimeClient) Route(from []float32, to []float32) (uint32, [][]float32)
- func (c *TravelTimeClient) SetSnapRadius(n float32)
- func (c TravelTimeClient) TravelTime(from []float32, to []float32) uint32
- func (c TravelTimeClient) TravelTimes(source []float32, targets [][]float32) []uint32
Constants ¶
This section is empty.
Variables ¶
var MaxDistance uint32
MaxDistance represents the maximum possible route distance.
Functions ¶
func ParseOSMSpeedToKM ¶ added in v0.1.2
Types ¶
type DistanceClient ¶
type DistanceClient struct {
// contains filtered or unexported fields
}
func NewDistanceClient ¶
func NewDistanceClient(mapFile string, profile Profile) (DistanceClient, error)
NewDistanceClient initializes a DistanceClient using the provided .osm.pbf file and .ch file. The .ch file will be created if it does not already exist. It is the caller's responsibility to call Delete on the client when it is no longer needed.
func (*DistanceClient) Delete ¶
func (c *DistanceClient) Delete()
Delete deletes the client, releasing memory allocated for C++ routing data structures
func (DistanceClient) Distance ¶
Distance returns the length of the shortest possible route between the points
func (DistanceClient) Distances ¶
Distances returns a slice containing the minimum distances from the source to the points in targets.
func (DistanceClient) Matrix ¶
Matrix creates a matrix representing the minimum distances from the points in sources to the points in targets.
func (DistanceClient) Nearest ¶
Nearest returns the nearest point in the road network within the radius configured on the Client. The second argument will be false if no point could be found.
func (DistanceClient) Route ¶
Route finds the fastest route between the two points, returning the total route distance and the waypoints describing the route.
func (*DistanceClient) SetSnapRadius ¶
func (c *DistanceClient) SetSnapRadius(n float32)
SetSnapRadius updates Client so that all queries will snap points to the nearest street network point within the given radius in meters.
type Profile ¶ added in v0.1.2
type Profile struct { Name string TransportMode TransportMode PreventLeftTurns bool PreventUTurns bool Filter TagMapFilter SpeedMapper SpeedMapper }
func NewProfile ¶ added in v0.1.2
func NewProfile( name string, transportMode TransportMode, preventLeftTurns bool, preventUTurns bool, filter TagMapFilter, speedMapper SpeedMapper, ) Profile
func Pedestrian ¶ added in v0.1.2
func Pedestrian() Profile
type TagMapFilter ¶ added in v0.1.2
type TransportMode ¶ added in v0.1.2
type TransportMode routingkit.Transport_mode
var ( VehicleMode TransportMode = TransportMode(routingkit.Vehicle) BikeMode TransportMode = TransportMode(routingkit.Bike) PedestrianMode TransportMode = TransportMode(routingkit.Pedestrian) )
type TravelTimeClient ¶
type TravelTimeClient struct {
// contains filtered or unexported fields
}
func NewTravelTimeClient ¶
func NewTravelTimeClient(mapFile string, profile Profile) (TravelTimeClient, error)
NewTravelTimeClient initializes a TravelTimeClient using the provided .osm.pbf file and .ch file. The .ch file will be created if it does not already exist. It is the caller's responsibility to call Delete on the client when it is no longer needed.
func (TravelTimeClient) Matrix ¶
func (c TravelTimeClient) Matrix(sources [][]float32, targets [][]float32) [][]uint32
Matrix creates a matrix representing the minimum travel times (by car) from the points in sources to the points in targets.
func (TravelTimeClient) Nearest ¶
func (c TravelTimeClient) Nearest(point []float32) ([]float32, bool)
Nearest returns the nearest point in the road network within the radius configured on the Client. The second argument will be false if no point could be found.
func (TravelTimeClient) Route ¶
func (c TravelTimeClient) Route(from []float32, to []float32) (uint32, [][]float32)
Route finds the fastest route between the two points, returning the total route travel time by car and the waypoints describing the route.
func (*TravelTimeClient) SetSnapRadius ¶
func (c *TravelTimeClient) SetSnapRadius(n float32)
SetSnapRadius updates Client so that all queries will snap points to the nearest street network point within the given radius in meters.
func (TravelTimeClient) TravelTime ¶
func (c TravelTimeClient) TravelTime(from []float32, to []float32) uint32
TravelTime returns the travel time by car for the shortest possible route between the points.
func (TravelTimeClient) TravelTimes ¶
func (c TravelTimeClient) TravelTimes(source []float32, targets [][]float32) []uint32
TravelTimes returns a slice containing the minimum car travel times from the source to the points in targets.