Documentation
¶
Index ¶
- func Distance2d(a, b [2]float64) float64
- func DistanceHaversine(lon1, lat1, lon2, lat2 float64) float64
- func DistanceHaversinePoint(a, b []float64) float64
- func InterpolateStopTimes(stoptimes []tl.StopTime) ([]tl.StopTime, error)
- func Length2d(line [][2]float64) float64
- func LengthHaversine(line [][2]float64) float64
- func LineClosestPoint(line [][2]float64, point [2]float64) ([2]float64, float64)
- func LinePositions(line [][2]float64, points [][2]float64) []float64
- func LinePositionsFallback(line [][2]float64) []float64
- func SegmentClosestPoint(a, b, p [2]float64) ([2]float64, float64)
- type GeomCache
- func (g *GeomCache) AddShape(eid string, shape tl.Shape)
- func (g *GeomCache) AddSimplifiedShape(eid string, shape tl.Shape, threshold float64)
- func (g *GeomCache) AddStop(eid string, stop tl.Stop)
- func (g *GeomCache) GetShape(eid string) [][2]float64
- func (g *GeomCache) GetStop(eid string) [2]float64
- func (g *GeomCache) InterpolateStopTimes(trip tl.Trip) ([]tl.StopTime, error)
- func (g *GeomCache) MakeShape(stopids ...string) (tl.Shape, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Distance2d ¶
Distance2d returns the cartesian distance
func DistanceHaversine ¶
DistanceHaversine .
func DistanceHaversinePoint ¶
DistanceHaversinePoint .
func InterpolateStopTimes ¶
InterpolateStopTimes sets missing ArrivalTime, DestinationTime values. StopTimes must be sorted and valid.
func LengthHaversine ¶
LengthHaversine returns the Haversine approximate length of a line.
func LineClosestPoint ¶
LineClosestPoint returns the point (and position) on line closest to point. Based on go-geom DistanceFromPointToLineString
func LinePositions ¶
LinePositions finds the relative position of the closest point along the line for each point.
func LinePositionsFallback ¶
LinePositionsFallback returns the relative position along the line for each point.
func SegmentClosestPoint ¶
SegmentClosestPoint returns the point (and position) on AB closest to P.
Types ¶
type GeomCache ¶
type GeomCache struct {
// contains filtered or unexported fields
}
GeomCache helps speed up StopTime interpolating by caching various results
func (*GeomCache) AddSimplifiedShape ¶ added in v0.8.1
AddSimplifiedShape adds a simplified Shape to the geometry cache.
func (*GeomCache) InterpolateStopTimes ¶
InterpolateStopTimes uses the cached geometries to interpolate StopTimes.