rules

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgencyIDConditionallyRequiredCheck

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

AgencyIDConditionallyRequiredCheck checks if agency_id is missing when more than one agency is present. This check is for when agency_id is *required* - see AgencyIDRecommendedCheck for when it is recommended but not required.

func (*AgencyIDConditionallyRequiredCheck) Validate

Validate .

type AgencyIDRecommendedCheck

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

AgencyIDRecommendedCheck checks if agency_id is missing when more than one agency is present.

func (*AgencyIDRecommendedCheck) Validate

func (e *AgencyIDRecommendedCheck) Validate(ent tl.Entity) []error

Validate .

type BlockOverlapCheck

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

BlockOverlapCheck checks for BlockOverlapErrors.

func (*BlockOverlapCheck) Validate

func (e *BlockOverlapCheck) Validate(ent tl.Entity) []error

Validate .

type BlockOverlapError

type BlockOverlapError struct {
	BlockID        string
	ServiceID      string
	TripID         string
	StartTime      tl.WideTime
	EndTime        tl.WideTime
	OtherTripID    string
	OtherStartTime tl.WideTime
	OtherEndTime   tl.WideTime
	// contains filtered or unexported fields
}

BlockOverlapError reports when two block_id's with the same service_id overlap in time.

func (*BlockOverlapError) Error

func (e *BlockOverlapError) Error() string

type CalendarDuplicateDates added in v0.10.0

type CalendarDuplicateDates struct {
}

func (*CalendarDuplicateDates) Validate added in v0.10.0

func (e *CalendarDuplicateDates) Validate(ent tl.Entity) []error

type DescriptionEqualsName

type DescriptionEqualsName struct{}

DescriptionEqualsName checks that route_desc does not duplicate route_short_name or route_long_name.

func (*DescriptionEqualsName) Validate

func (e *DescriptionEqualsName) Validate(ent tl.Entity) []error

Validate .

type DuplicateFareRuleCheck

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

DuplicateFareRuleCheck checks for DuplicateFareRuleErrors.

func (*DuplicateFareRuleCheck) Validate

func (e *DuplicateFareRuleCheck) Validate(ent tl.Entity) []error

Validate .

type DuplicateFareRuleError

type DuplicateFareRuleError struct {
	RouteID       string
	OriginID      string
	DestinationID string
	ContainsID    string
	// contains filtered or unexported fields
}

DuplicateFareRuleError reports when multiple FareRules have the same (route_id,origin_id,_destination_id,contains_id)

func (*DuplicateFareRuleError) Error

func (e *DuplicateFareRuleError) Error() string

type DuplicateRouteNameCheck

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

DuplicateRouteNameCheck checks for routes of the same agency with identical route_long_names.

func (*DuplicateRouteNameCheck) Validate

func (e *DuplicateRouteNameCheck) Validate(ent tl.Entity) []error

Validate .

type DuplicateRouteNameError

type DuplicateRouteNameError struct {
	RouteID       string
	RouteLongName string
	RouteType     int
	AgencyID      string
	OtherRouteID  string
	// contains filtered or unexported fields
}

DuplicateRouteNameError reports when routes of the same agency have identical route_long_name values.

func (*DuplicateRouteNameError) Error

func (e *DuplicateRouteNameError) Error() string

type EntityDuplicateCheck

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

EntityDuplicateCheck determines if a unique entity ID is present more than once in the file.

func (*EntityDuplicateCheck) Validate

func (e *EntityDuplicateCheck) Validate(ent tl.Entity) []error

Validate .

type EntityErrorCheck

type EntityErrorCheck struct{}

EntityErrorCheck runs the entity's built in Errors() check.

func (*EntityErrorCheck) Validate

func (e *EntityErrorCheck) Validate(ent tl.Entity) []error

Validate .

type FastTravelError

type FastTravelError struct {
	TripID       string
	StopSequence int
	FromStopID   string
	ToStopID     string
	Distance     float64
	Time         int
	Speed        float64
	SpeedLimit   float64
	// contains filtered or unexported fields
}

FastTravelError reports when reasonable maximum speeds have been exceeded for at least 30 seconds.

func (*FastTravelError) Error

func (e *FastTravelError) Error() string

type FrequencyDurationCheck

type FrequencyDurationCheck struct{}

FrequencyDurationCheck reports when a frequencies.txt entry has (start_time,end_time) less than a full headway.

func (*FrequencyDurationCheck) Validate

func (e *FrequencyDurationCheck) Validate(ent tl.Entity) []error

Validate .

type FrequencyOverlapCheck

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

FrequencyOverlapCheck checks for FrequencyOverlapErrors.

func (*FrequencyOverlapCheck) Validate

func (e *FrequencyOverlapCheck) Validate(ent tl.Entity) []error

Validate .

type FrequencyOverlapError

type FrequencyOverlapError struct {
	StartTime      tl.WideTime
	EndTime        tl.WideTime
	OtherStartTime tl.WideTime
	OtherEndTime   tl.WideTime
	TripID         string
	// contains filtered or unexported fields
}

FrequencyOverlapError is reported when two frequencies.txt entries for the same trip overlap in time.

func (*FrequencyOverlapError) Error

func (e *FrequencyOverlapError) Error() string

type InconsistentTimezoneCheck

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

InconsistentTimezoneCheck checks for InconsistentTimezoneErrors.

func (*InconsistentTimezoneCheck) Validate

func (e *InconsistentTimezoneCheck) Validate(ent tl.Entity) []error

Validate .

type InconsistentTimezoneError

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

InconsistentTimezoneError reports when agency.txt has more than 1 unique timezone present.

func NewInconsistentTimezoneError

func NewInconsistentTimezoneError(value string) *InconsistentTimezoneError

NewInconsistentTimezoneError returns a new InconsistentTimezoneError.

func (*InconsistentTimezoneError) Error

func (e *InconsistentTimezoneError) Error() string

type InsufficientColorContrastCheck

type InsufficientColorContrastCheck struct{}

InsufficientColorContrastCheck checks that when route_color and route_text_color are specified, sufficient contrast exists to be legible.

func (*InsufficientColorContrastCheck) Validate

func (e *InsufficientColorContrastCheck) Validate(ent tl.Entity) []error

Validate .

type InvalidFarezoneError

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

InvalidFarezoneError reports when a farezone does not exist.

func NewInvalidFarezoneError

func NewInvalidFarezoneError(field string, value string) *InvalidFarezoneError

NewInvalidFarezoneError returns a new InvalidFarezoneError

func (*InvalidFarezoneError) Error

func (e *InvalidFarezoneError) Error() string

type InvalidParentStationError

type InvalidParentStationError struct {
	StopID            string
	LocationType      int
	ParentStation     string
	ParentStationType int
	// contains filtered or unexported fields
}

InvalidParentStationError reports when a parent_station has a location_type that is not allowed.

func (*InvalidParentStationError) Error

func (e *InvalidParentStationError) Error() string

type MinTransferTimeCheck

type MinTransferTimeCheck struct{}

MinTransferTimeCheck reports when min_transfer_type is required to be set

func (*MinTransferTimeCheck) Validate

func (e *MinTransferTimeCheck) Validate(ent tl.Entity) []error

Validate .

type NoScheduledServiceCheck

type NoScheduledServiceCheck struct{}

NoScheduledServiceCheck checks for NoScheduledServiceErrors.

func (*NoScheduledServiceCheck) Validate

func (e *NoScheduledServiceCheck) Validate(ent tl.Entity) []error

Validate .

type NoScheduledServiceError

type NoScheduledServiceError struct {
	ServiceID string
	// contains filtered or unexported fields
}

NoScheduledServiceError reports when a service entry contains no active days.

func (*NoScheduledServiceError) Error

func (e *NoScheduledServiceError) Error() string

type NullIslandCheck

type NullIslandCheck struct{}

NullIslandCheck checks for ZeroCoordinateError.

func (*NullIslandCheck) Validate

func (e *NullIslandCheck) Validate(ent tl.Entity) []error

Validate .

type ParentStationLocationTypeCheck

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

ParentStationLocationTypeCheck checks for InvalidParentStationErrors.

func (*ParentStationLocationTypeCheck) Validate

func (e *ParentStationLocationTypeCheck) Validate(ent tl.Entity) []error

Validate .

type RouteExtendedTypesCheck

type RouteExtendedTypesCheck struct{}

RouteExtendedTypesCheck reports a Best Practices warning when extended route_type values are used. These are not well supported.

func (*RouteExtendedTypesCheck) Validate

func (e *RouteExtendedTypesCheck) Validate(ent tl.Entity) []error

Validate .

type RouteShortNameTooLongCheck

type RouteShortNameTooLongCheck struct{}

RouteShortNameTooLongCheck checks if route_short_name is, well, too long.

func (*RouteShortNameTooLongCheck) Validate

func (e *RouteShortNameTooLongCheck) Validate(ent tl.Entity) []error

Validate .

type ServiceAllDaysEmptyCheck

type ServiceAllDaysEmptyCheck struct{}

ServiceAllDaysEmptyCheck checks if a calendar.txt entry, non-generated, has at least one day of week marked as 1.

func (*ServiceAllDaysEmptyCheck) Validate

func (e *ServiceAllDaysEmptyCheck) Validate(ent tl.Entity) []error

Validate .

type ShortServiceCheck

type ShortServiceCheck struct{}

ShortServiceCheck checks that a calendar.txt entry has (start_date,end_date) of more than 1 day.

func (*ShortServiceCheck) Validate

func (e *ShortServiceCheck) Validate(ent tl.Entity) []error

Validate .

type StopTimeFastTravelCheck

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

StopTimeFastTravelCheck checks for FastTravelErrors.

func (*StopTimeFastTravelCheck) SetGeomCache

func (e *StopTimeFastTravelCheck) SetGeomCache(g *xy.GeomCache)

SetGeomCache sets a shared geometry cache.

func (*StopTimeFastTravelCheck) Validate

func (e *StopTimeFastTravelCheck) Validate(ent tl.Entity) []error

Validate .

type StopTimeSequenceCheck

type StopTimeSequenceCheck struct{}

StopTimeSequenceCheck checks that all sequences stop_time sequences in a trip are valid. This should be split into multiple validators.

func (*StopTimeSequenceCheck) Validate

func (e *StopTimeSequenceCheck) Validate(ent tl.Entity) []error

Validate .

type StopTooCloseCheck

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

StopTooCloseCheck checks for StopTooCloseErrors.

func (*StopTooCloseCheck) Validate

func (e *StopTooCloseCheck) Validate(ent tl.Entity) []error

Validate .

type StopTooCloseError

type StopTooCloseError struct {
	StopID      string
	OtherStopID string
	Distance    float64
	// contains filtered or unexported fields
}

StopTooCloseError reports when two stops of location_type = 0 that have no parent are within 1m of each other.

func (*StopTooCloseError) Error

func (e *StopTooCloseError) Error() string

type StopTooFarCheck

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

StopTooFarCheck checks for StopTooFarErrors.

func (*StopTooFarCheck) Validate

func (e *StopTooFarCheck) Validate(ent tl.Entity) []error

Validate .

type StopTooFarError

type StopTooFarError struct {
	StopID        string
	ParentStation string
	Distance      float64
	// contains filtered or unexported fields
}

StopTooFarError reports when two related stops are >1km away.

func (*StopTooFarError) Error

func (e *StopTooFarError) Error() string

type StopTooFarFromShapeCheck

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

StopTooFarFromShapeCheck checks for StopTooFarFromShapeErrors.

func (*StopTooFarFromShapeCheck) SetGeomCache

func (e *StopTooFarFromShapeCheck) SetGeomCache(g *xy.GeomCache)

SetGeomCache sets a shared geometry cache.

func (*StopTooFarFromShapeCheck) Validate

func (e *StopTooFarFromShapeCheck) Validate(ent tl.Entity) []error

Validate .

type StopTooFarFromShapeError

type StopTooFarFromShapeError struct {
	TripID   string
	StopID   string
	ShapeID  string
	Distance float64
	// contains filtered or unexported fields
}

StopTooFarFromShapeError reports when a stop is too far from a shape.

func (*StopTooFarFromShapeError) Error

func (e *StopTooFarFromShapeError) Error() string

type UnusedEntityError

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

UnusedEntityError reports when an entity is present but not referenced.

func (*UnusedEntityError) Error

func (e *UnusedEntityError) Error() string

type ValidFarezoneCheck

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

ValidFarezoneCheck checks for InvalidFarezoneErrors.

func (*ValidFarezoneCheck) Validate

func (e *ValidFarezoneCheck) Validate(ent tl.Entity) []error

Validate .

type ZeroCoordinateError

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

ZeroCoordinateError reports when a required geometry has a (0,0) coordinate.

func (*ZeroCoordinateError) Error

func (e *ZeroCoordinateError) Error() string

Jump to

Keyboard shortcuts

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