ggtfs

package
v0.0.0-...-cf1870d Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgenciesFileName      = "agency.txt"
	RoutesFileName        = "routes.txt"
	StopsFileName         = "stops.txt"
	TripsFileName         = "trips.txt"
	StopTimesFileName     = "stop_times.txt"
	CalendarFileName      = "calendar.txt"
	CalendarDatesFileName = "calendar_dates.txt"
	ShapesFileName        = "shapes.txt"
)

Variables

This section is empty.

Functions

func ReadDataRow

func ReadDataRow(r *csv.Reader) ([]string, error)

func ReadHeaderRow

func ReadHeaderRow(r *csv.Reader) (map[string]uint8, error)

func StringArrayContainsItem

func StringArrayContainsItem(s []string, e string) bool

func ValidateCalendarDates

func ValidateCalendarDates(calendarDates []*CalendarDate, calendarItems []*CalendarItem) []error

func ValidateRoutes

func ValidateRoutes(routes []*Route, agencies []*Agency) []error

func ValidateShapes

func ValidateShapes(shapes []*Shape) []error

func ValidateStoptimes

func ValidateStoptimes(stopTimes []*StopTime, stops []*Stop) []error

func ValidateTrips

func ValidateTrips(trips []*Trip, routes []*Route, calendarItems []*CalendarItem, shapes []*Shape) []error

Types

type Agency

type Agency struct {
	Id       *string // agency_id
	Name     string  // agency_name
	Url      string  // agency_url
	Timezone string  // agency_timezone
	Lang     *string // agency_lang
	Phone    *string // agency_phone
	FareURL  *string // agency_fare_url
	Email    *string // agency_email
	// contains filtered or unexported fields
}

func LoadAgencies

func LoadAgencies(csvReader *csv.Reader) ([]*Agency, []error)

type CalendarDate

type CalendarDate struct {
	ServiceId     string
	Date          time.Time
	ExceptionType int
	LineNumber    int
}

func LoadCalendarDates

func LoadCalendarDates(csvReader *csv.Reader) ([]*CalendarDate, []error)

type CalendarItem

type CalendarItem struct {
	ServiceId string
	Monday    int
	Tuesday   int
	Wednesday int
	Thursday  int
	Friday    int
	Saturday  int
	Sunday    int
	Start     time.Time
	End       time.Time
	// contains filtered or unexported fields
}

func LoadCalendarItems

func LoadCalendarItems(csvReader *csv.Reader) ([]*CalendarItem, []error)

type FareAttributes

type FareAttributes struct {
	Id               string
	Price            float64
	CurrencyType     string
	PaymentMethod    int
	Transfers        int
	AgencyId         *string
	TransferDuration *uint
	LineNumber       int
}

type FareRule

type FareRule struct {
	Id            string
	RouteId       *string
	OriginId      *string
	DestinationId *string
	ContainsId    *string
	LineNumber    int
}

type Frequency

type Frequency struct {
	TripId      string
	StartTime   string
	EndTime     string
	HeadwaySecs uint
	ExactTimes  *int
	LineNumber  int
}

type Level

type Level struct {
	Id         string
	LevelIndex float64
	LevelName  string
	LineNumber int
}

type Pathway

type Pathway struct {
	Id                  string
	FromStopId          string
	ToStopId            string
	PathwayMode         uint
	IsBidirectional     uint
	Length              float64
	TraversalTime       uint
	StairCount          uint
	MaxSlope            float64
	MinWidth            float64
	SignpostedAs        string
	ReverseSignpostedAs string
	LineNumber          int
}

type Route

type Route struct {
	Id                string
	AgencyId          *string
	ShortName         *string
	LongName          *string
	Desc              *string
	Type              int
	Url               *string
	Color             *string
	TextColor         *string
	SortOrder         *int
	ContinuousPickup  *int
	ContinuousDropOff *int
	// contains filtered or unexported fields
}

func LoadRoutes

func LoadRoutes(csvReader *csv.Reader) ([]*Route, []error)

type Shape

type Shape struct {
	Id           string
	PtLat        float64
	PtLon        float64
	PtSequence   int
	DistTraveled *float64
	// contains filtered or unexported fields
}

func LoadShapes

func LoadShapes(csvReader *csv.Reader) ([]*Shape, []error)

type Stop

type Stop struct {
	Id                 string
	Code               *string
	Name               *string
	Desc               *string
	Lat                *float64
	Lon                *float64
	ZoneId             *string
	Url                *string
	LocationType       *int
	ParentStation      *string
	Timezone           *string
	WheelchairBoarding *int
	PlatformCode       *string
	LevelId            *string
	MunicipalityId     *string
	// contains filtered or unexported fields
}

func LoadStops

func LoadStops(csvReader *csv.Reader) ([]*Stop, []error)

type StopTime

type StopTime struct {
	TripId            string
	ArrivalTime       string
	DepartureTime     string
	StopId            string
	StopSequence      int
	StopHeadSign      *string
	PickupType        *int
	DropOffType       *int
	ContinuousPickup  *int
	ContinuousDropOff *int
	ShapeDistTraveled *float64
	Timepoint         *int
	// contains filtered or unexported fields
}

func LoadStopTimes

func LoadStopTimes(csvReader *csv.Reader) ([]*StopTime, []error)

type Transfer

type Transfer struct {
	FromStopId      string
	ToStopId        string
	TransferType    uint
	MinTransferTime uint
	LineNumber      int
}

type Trip

type Trip struct {
	Id                   string
	RouteId              string
	ServiceId            string
	HeadSign             *string
	ShortName            *string
	DirectionId          *int
	BlockId              *string
	ShapeId              *string
	WheelchairAccessible *int
	BikesAllowed         *int
	// contains filtered or unexported fields
}

func LoadTrips

func LoadTrips(csvReader *csv.Reader) ([]*Trip, []error)

Jump to

Keyboard shortcuts

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