gtfs

package
v0.0.0-...-b1188a6 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NoShapeDistTraveled = float64(-42.42)

Variables

View Source
var NoPoint = Point{-4242, -4242}

Functions

func AtNoonMinus12h

func AtNoonMinus12h(t time.Time, loc *time.Location) time.Time

Types

type Agency

type Agency struct {
	ID       string
	Name     string
	URL      string
	Timezone *time.Location
	Lang     string
	Phone    string
	FareURL  string
	Email    string
}

type Calendar

type Calendar struct {
	ServiceID string
	Monday    bool
	Tuesday   bool
	Wednesday bool
	Thursday  bool
	Friday    bool
	Saturday  bool
	Sunday    bool
	StartDate time.Time
	EndDate   time.Time
}

type CalendarDate

type CalendarDate struct {
	ServiceID     string
	Date          time.Time
	ExceptionType string
}

type Point

type Point struct {
	Lat float64
	Lon float64
}

func (Point) String

func (p Point) String() string

type Route

type Route struct {
	ID        string
	AgencyID  string
	ShortName string
	LongName  string
	Desc      string
	Type      int
	URL       string
	Color     string
	TextColor string
}

type Shape

type Shape struct {
	ID           string
	Point        Point
	PtSequence   int
	DistTraveled float64
}

type Static

type Static struct {
	Agencies      []Agency
	Stops         []Stop
	Routes        []Route
	Trips         []Trip
	StopTimes     []StopTime
	Calendar      []Calendar
	CalendarDates []CalendarDate
	Shapes        []Shape

	RouteIDsToRoutes   map[string]*Route
	StopIDsToStops     map[string]*Stop
	StopIDsToStopTimes map[string][]StopTime
	TripIDsToTrips     map[string]*Trip
}

func ReadZip

func ReadZip(r io.ReaderAt, size int64) (*Static, error)

func ReadZipFile

func ReadZipFile(path string) (*Static, error)

func (*Static) ActiveServicesForDate

func (s *Static) ActiveServicesForDate(d time.Time) map[string]bool

func (*Static) CalendarForServiceID

func (s *Static) CalendarForServiceID(serviceID string) (Calendar, error)

func (*Static) FillMaps

func (s *Static) FillMaps()

func (*Static) TripIDsForRouteID

func (s *Static) TripIDsForRouteID(routeID string) map[string]bool

func (*Static) TripIDsForServiceIDs

func (s *Static) TripIDsForServiceIDs(serviceIDs map[string]bool) map[string]bool

type Stop

type Stop struct {
	ID                 string
	Code               string
	Name               string
	Desc               string
	Point              Point
	ZoneID             string
	URL                string
	LocationType       int
	ParentStation      string
	Timezone           string
	WheelchairBoarding int
}

type StopTime

type StopTime struct {
	TripID            string
	ArrivalTime       time.Duration
	DepartureTime     time.Duration
	StopID            string
	StopSequence      int
	StopHeadsign      string
	PickupType        int
	DropOffType       int
	ShapeDistTraveled float64
	Timepoint         int
}

type Trip

type Trip struct {
	RouteID              string
	ServiceID            string
	ID                   string
	Headsign             string
	ShortName            string
	DirectionID          int
	BlockID              string
	ShapeID              string
	WheelchairAccessible int
	BikesAllowed         int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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