geomcache

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterpolateStopTimes

func InterpolateStopTimes(stoptimes []gtfs.StopTime) ([]gtfs.StopTime, error)

InterpolateStopTimes sets missing ArrivalTime, DestinationTime values. StopTimes must be sorted and valid.

Types

type GeomCache

type GeomCache struct {
	// contains filtered or unexported fields
}

GeomCache helps speed up StopTime interpolating by caching various results

func NewGeomCache

func NewGeomCache() *GeomCache

NewGeomCache returns an initialized geomCache

func (*GeomCache) AddShapeGeom

func (g *GeomCache) AddShapeGeom(eid string, line []tlxy.Point, dists []float64)

func (*GeomCache) AddStopGeom

func (g *GeomCache) AddStopGeom(eid string, pt tlxy.Point)

AddStopGeom adds a Stop to the geometry cache.

func (*GeomCache) GetShape

func (g *GeomCache) GetShape(eid string) []tlxy.Point

GetShape returns the coordinates for the cached shape.

func (*GeomCache) GetShapeInfo

func (g *GeomCache) GetShapeInfo(eid string) ShapeInfo

func (*GeomCache) GetStop

func (g *GeomCache) GetStop(eid string) tlxy.Point

GetStop returns the coordinates for the cached stop.

func (*GeomCache) InterpolateStopTimes

func (g *GeomCache) InterpolateStopTimes(trip *gtfs.Trip) ([]gtfs.StopTime, error)

InterpolateStopTimes uses the cached geometries to interpolate StopTimes. TODO: move to somewhere else

func (*GeomCache) MakeShape

func (g *GeomCache) MakeShape(stopids ...string) ([]tlxy.Point, []float64, error)

MakeShape returns geometry for the given stops.

type ShapeInfo

type ShapeInfo struct {
	Line       []tlxy.Point
	DistLength float64
}

Jump to

Keyboard shortcuts

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