Documentation
¶
Index ¶
- func Distance2d(a, b Point) 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 []Point) float64
- func LengthHaversine(line []Point) float64
- func LinePositions(line []Point, points []Point) []float64
- func LinePositionsFallback(line []Point) []float64
- func PointSliceContains(a []Point, b []Point) bool
- func PointSliceEqual(a []Point, b []Point) bool
- type GeomCache
- func (g *GeomCache) AddShape(eid string, shape tl.Shape)
- func (g *GeomCache) AddStop(eid string, stop tl.Stop)
- func (g *GeomCache) GetShape(eid string) []Point
- func (g *GeomCache) GetStop(eid string) Point
- func (g *GeomCache) InterpolateStopTimes(trip tl.Trip) ([]tl.StopTime, error)
- func (g *GeomCache) MakeShape(stopids ...string) (tl.Shape, error)
- type Point
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 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 PointSliceContains ¶ added in v0.11.0
func PointSliceEqual ¶ added in v0.11.0
Types ¶
type GeomCache ¶
type GeomCache struct {
// contains filtered or unexported fields
}
GeomCache helps speed up StopTime interpolating by caching various results
func (*GeomCache) InterpolateStopTimes ¶
InterpolateStopTimes uses the cached geometries to interpolate StopTimes.
type Point ¶ added in v0.8.8
func LineClosestPoint ¶
LineClosestPoint returns the point (and position) on line closest to point. Based on go-geom DistanceFromPointToLineString
func SegmentClosestPoint ¶
SegmentClosestPoint returns the point (and position) on AB closest to P.