schedules

package
v0.0.0-...-fa793e7 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadGTFSServices

func LoadGTFSServices(calendarDates io.Reader, period FeedDates) (map[string][]DatePair, error)

func LoadGTFSStopTimes

func LoadGTFSStopTimes(stopTimes io.Reader, tripIDs map[string][]TripID, tripObjects map[TripID]*Trip, canonicalStops map[string]string) error

func LoadGTFSStops

func LoadGTFSStops(stops io.Reader) (map[string]string, error)

func LoadGTFSTrips

func LoadGTFSTrips(trips io.Reader, services map[string][]DatePair) (map[string][]TripID, map[TripID]*Trip, error)

Types

type DatePair

type DatePair struct {
	GTFSDate time2.Date
	PLKDate  time2.Date
}

type ErrGTFSInvalidPLKTripID

type ErrGTFSInvalidPLKTripID string

func (ErrGTFSInvalidPLKTripID) Error

func (e ErrGTFSInvalidPLKTripID) Error() string

type ErrGTFSInvalidValue

type ErrGTFSInvalidValue struct {
	File, Column string
	Line         int
	Reason       error
}

func (ErrGTFSInvalidValue) Error

func (e ErrGTFSInvalidValue) Error() string

func (ErrGTFSInvalidValue) Unwrap

func (e ErrGTFSInvalidValue) Unwrap() error

type FeedDates

type FeedDates struct {
	Start, End time2.Date
}

func LoadGTFSFeedDates

func LoadGTFSFeedDates(feedInfo io.Reader) (d FeedDates, err error)

func (FeedDates) Contains

func (fd FeedDates) Contains(d time2.Date) bool

type NumberID

type NumberID struct {
	AgencyID     string
	Number       string
	PLKStartDate time2.Date
}

type Package

type Package struct {
	Dates                 FeedDates
	Stops                 map[string]string
	Trips                 map[TripID]*Trip
	TripsByNumber         map[NumberID]*Trip
	AlternativeTripLookup map[TripID]NumberID
}

func LoadGTFS

func LoadGTFS(gtfs fs.FS) (p *Package, err error)

func LoadGTFSFromPath

func LoadGTFSFromPath(path string) (*Package, error)

func (*Package) RebuidNumberIndex

func (p *Package) RebuidNumberIndex()

type StopTime

type StopTime struct {
	GTFSTripID   string
	StopID       string
	GTFSSequence int
	PLKSequence  int
	Platform     string
	Track        string
}

type Trip

type Trip struct {
	AgencyID      string
	GTFSStartDate time2.Date
	PLKStartDate  time2.Date
	Numbers       []string
	StopTimes     []StopTime
}

func (*Trip) GetNumberIDs

func (t *Trip) GetNumberIDs() iter.Seq[NumberID]

func (*Trip) GetStopIDs

func (t *Trip) GetStopIDs() (ids set.Set[string])

func (*Trip) GetTripIDs

func (t *Trip) GetTripIDs() (ids []string)

type TripID

type TripID struct {
	ScheduleID   int
	OrderID      int
	PLKStartDate time2.Date
}

Jump to

Keyboard shortcuts

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