filters

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package filters provides tools for modifying and transforming streams of GTFS entities. Used with copier.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyDefaultAgencyFilter

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

ApplDefaultAgencyFilter sets a default agency_id value in relevant fields when the value is empty, e.g. routes.txt agency_id. It will only set a default agency_id value when the feed contains a single agency.

func (*ApplyDefaultAgencyFilter) Filter

func (e *ApplyDefaultAgencyFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error

type ApplyParentTimezoneFilter

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

ApplyParentTimezoneFilter sets timezone based on the default agency timezone or parent stop timezone Can be used with NormalizeTimezoneFilter

func (*ApplyParentTimezoneFilter) Filter

func (e *ApplyParentTimezoneFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error

type ApplyTimezoneFilter

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

ApplyTimezoneFilter sets all timezones in the file to the specified value

func NewApplyTimezoneFilter

func NewApplyTimezoneFilter(timezone string) (*ApplyTimezoneFilter, error)

func (*ApplyTimezoneFilter) Filter

func (e *ApplyTimezoneFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error

type BasicRouteTypeFilter

type BasicRouteTypeFilter struct{}

BasicRouteTypeFilter checks for extended route_type's and converts to basic route_types.

func (*BasicRouteTypeFilter) Filter

func (e *BasicRouteTypeFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error

Filter converts extended route_types to basic route_types.

type NormalizeTimezoneFilter

type NormalizeTimezoneFilter struct{}

NormalizeTimezoneFilter changes a timezone alias to a normalized timezone, e.g. "US/Pacific" -> "America/Los_Angeles"

func (*NormalizeTimezoneFilter) Filter

func (e *NormalizeTimezoneFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error

Validate .

type PrefixFilter

type PrefixFilter struct {
	PrefixAll bool
	// contains filtered or unexported fields
}

func NewPrefixFilter

func NewPrefixFilter() (*PrefixFilter, error)

func (*PrefixFilter) Filter

func (filter *PrefixFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error

func (*PrefixFilter) PrefixFile

func (filter *PrefixFilter) PrefixFile(fn string)

func (*PrefixFilter) SetPrefix

func (filter *PrefixFilter) SetPrefix(fvid int, prefix string)

type RedateFilter

type RedateFilter struct {
	SourceDate    time.Time
	SourceDays    int
	TargetDate    time.Time
	TargetDays    int
	DOWAlign      bool
	AllowInactive bool
	// contains filtered or unexported fields
}

func NewRedateFilter

func NewRedateFilter(sourceDate, targetDate time.Time, SourceDays, targetDays int, dowAlign bool) (*RedateFilter, error)

func (*RedateFilter) Filter

func (tf *RedateFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error

Jump to

Keyboard shortcuts

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