Documentation
¶
Overview ¶
This package is for compound entities, e.g. calendar services and shape lines
Index ¶
- func FlattenShape(ent ShapeLine) []gtfs.Shape
- func ValidateShapes(shapes []gtfs.Shape) []error
- type Service
- func (s *Service) AddCalendarDate(cd gtfs.CalendarDate) error
- func (s *Service) CalendarDates() []gtfs.CalendarDate
- func (s *Service) Exception(t time.Time) (int, bool)
- func (s *Service) GetWeekday(dow int) (int, error)
- func (s *Service) HasAtLeastOneDay() bool
- func (s *Service) IsActive(t time.Time) bool
- func (s *Service) Reset()
- func (s *Service) ServicePeriod() (time.Time, time.Time)
- func (s *Service) SetWeekday(dow int, value int) error
- func (s *Service) Simplify() (*Service, error)
- type ShapeLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenShape ¶
func ValidateShapes ¶
ValidateShapes returns errors for an array of shapes.
Types ¶
type Service ¶
Service is a Calendar / CalendarDate union.
func NewService ¶
func NewService(c gtfs.Calendar, cds ...gtfs.CalendarDate) *Service
NewService returns a new Service.
func NewServicesFromReader ¶
NewServicesFromReader returns the reader's Calendar and CalendarDate entities as a Service
func (*Service) AddCalendarDate ¶
func (s *Service) AddCalendarDate(cd gtfs.CalendarDate) error
AddCalendarDate adds a service exception.
func (*Service) CalendarDates ¶
func (s *Service) CalendarDates() []gtfs.CalendarDate
CalendarDates returns CalendarDates for this service.
func (*Service) GetWeekday ¶
GetWeekday returns the value fo the day of week.
func (*Service) HasAtLeastOneDay ¶
HasAtLeastOneDay checks if the Service is active for at least one day.
func (*Service) ServicePeriod ¶
ServicePeriod returns the widest possible range of days with transit service, including service exceptions.
func (*Service) SetWeekday ¶
SetWeekday sets the day of week.
type ShapeLine ¶
type ShapeLine struct { ShapeID tt.String `csv:",required"` Geometry tt.LineString `db:"geometry" csv:"-"` Generated bool `db:"generated" csv:"-"` tt.BaseEntity }
Shape shapes.txt
func NewShapeLineFromShapes ¶
NewShapeFromShapes takes Shapes with single points and returns a Shape with linestring geometry. Any errors from the input errors, or errors such as duplicate sequences, are added as entity errors.