Documentation
¶
Overview ¶
Package rules provides a number of GTFS validation rules and examples.
Index ¶
- func ValidateStopTimes(stoptimes []gtfs.StopTime) []error
- type AgencyIDConditionallyRequiredCheck
- type AgencyIDRecommendedCheck
- type BlockOverlapCheck
- type BlockOverlapError
- type CalendarDuplicateDates
- type DescriptionEqualsName
- type DuplicateRouteNameCheck
- type DuplicateRouteNameError
- type EntityDuplicateIDCheck
- type EntityDuplicateKeyCheck
- type FareProductRiderCategoryDefaultCheck
- type FastTravelError
- type FrequencyDurationCheck
- type FrequencyOverlapCheck
- type FrequencyOverlapError
- type InconsistentTimezoneCheck
- type InconsistentTimezoneError
- type InsufficientColorContrastCheck
- type InvalidFarezoneError
- type InvalidParentStationError
- type MinTransferTimeCheck
- type NoScheduledServiceCheck
- type NoScheduledServiceError
- type NullIslandCheck
- type ParentStationLocationTypeCheck
- type RouteExtendedTypesCheck
- type RouteNamesCharactersCheck
- type RouteNamesCharactersError
- type RouteNamesPrefixCheck
- type RouteNamesPrefixError
- type RouteShortNameTooLongCheck
- type ServiceAllDaysEmptyCheck
- type ShortServiceCheck
- type StopTimeFastTravelCheck
- type StopTimeSequenceCheck
- type StopTooCloseCheck
- type StopTooCloseError
- type StopTooFarCheck
- type StopTooFarError
- type StopTooFarFromShapeCheck
- type StopTooFarFromShapeError
- type UnusedEntityError
- type ValidFarezoneCheck
- type ZeroCoordinateError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateStopTimes ¶ added in v0.18.0
ValidateStopTimes checks if the trip follows GTFS rules.
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.
type AgencyIDRecommendedCheck ¶
type AgencyIDRecommendedCheck struct {
// contains filtered or unexported fields
}
AgencyIDRecommendedCheck checks if agency_id is missing when more than one agency is present.
type BlockOverlapCheck ¶
type BlockOverlapCheck struct {
// contains filtered or unexported fields
}
BlockOverlapCheck checks for BlockOverlapErrors.
type BlockOverlapError ¶
type BlockOverlapError struct {
BlockID string
ServiceID string
TripID string
StartTime tt.Seconds
EndTime tt.Seconds
OtherTripID string
OtherStartTime tt.Seconds
OtherEndTime tt.Seconds
// 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 {
}
type DescriptionEqualsName ¶
type DescriptionEqualsName struct{}
DescriptionEqualsName checks that route_desc does not duplicate route_short_name or route_long_name.
type DuplicateRouteNameCheck ¶
type DuplicateRouteNameCheck struct {
// contains filtered or unexported fields
}
DuplicateRouteNameCheck checks for routes of the same agency with identical route_long_names.
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 EntityDuplicateIDCheck ¶ added in v1.0.0
type EntityDuplicateIDCheck struct {
// contains filtered or unexported fields
}
EntityDuplicateCheck determines if a unique entity ID is present more than once in the file.
type EntityDuplicateKeyCheck ¶ added in v1.0.0
type EntityDuplicateKeyCheck struct {
// contains filtered or unexported fields
}
type FareProductRiderCategoryDefaultCheck ¶ added in v1.1.0
type FareProductRiderCategoryDefaultCheck struct {
// contains filtered or unexported fields
}
FareProductRiderCategoryDefaultCheck checks if agency_id is missing when more than one agency is present.
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.
type FrequencyOverlapCheck ¶
type FrequencyOverlapCheck struct {
// contains filtered or unexported fields
}
FrequencyOverlapCheck checks for FrequencyOverlapErrors.
type FrequencyOverlapError ¶
type FrequencyOverlapError struct {
StartTime tt.Seconds
EndTime tt.Seconds
OtherStartTime tt.Seconds
OtherEndTime tt.Seconds
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.
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.
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
type NoScheduledServiceCheck ¶
type NoScheduledServiceCheck struct{}
NoScheduledServiceCheck checks for NoScheduledServiceErrors.
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.
type ParentStationLocationTypeCheck ¶
type ParentStationLocationTypeCheck struct {
// contains filtered or unexported fields
}
ParentStationLocationTypeCheck checks for InvalidParentStationErrors.
func (*ParentStationLocationTypeCheck) AfterWrite ¶ added in v0.12.0
type RouteExtendedTypesCheck ¶
type RouteExtendedTypesCheck struct{}
RouteExtendedTypesCheck reports a Best Practices warning when extended route_type values are used. These are not well supported.
type RouteNamesCharactersCheck ¶ added in v0.13.0
type RouteNamesCharactersCheck struct{}
type RouteNamesCharactersError ¶ added in v0.13.0
type RouteNamesCharactersError struct {
// contains filtered or unexported fields
}
type RouteNamesPrefixCheck ¶ added in v0.13.0
type RouteNamesPrefixCheck struct {
}
type RouteNamesPrefixError ¶ added in v0.13.0
type RouteNamesPrefixError struct {
// contains filtered or unexported fields
}
type RouteShortNameTooLongCheck ¶
type RouteShortNameTooLongCheck struct{}
RouteShortNameTooLongCheck checks if route_short_name is, well, too long.
type ServiceAllDaysEmptyCheck ¶
type ServiceAllDaysEmptyCheck struct{}
ServiceAllDaysEmptyCheck checks if a calendar.txt entry, non-generated, has at least one day of week marked as 1.
type ShortServiceCheck ¶
type ShortServiceCheck struct{}
ShortServiceCheck checks that a calendar.txt entry has (start_date,end_date) of more than 1 day.
type StopTimeFastTravelCheck ¶
type StopTimeFastTravelCheck struct {
// contains filtered or unexported fields
}
StopTimeFastTravelCheck checks for FastTravelErrors.
func (*StopTimeFastTravelCheck) SetGeomCache ¶
func (e *StopTimeFastTravelCheck) SetGeomCache(g tlxy.GeomCache)
SetGeomCache sets a shared geometry cache.
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.
type StopTooCloseCheck ¶
type StopTooCloseCheck struct {
// contains filtered or unexported fields
}
StopTooCloseCheck checks for StopTooCloseErrors.
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.
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 tlxy.GeomCache)
SetGeomCache sets a shared geometry cache.
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.
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
Source Files
¶
- agency_id_recommended.go
- agency_id_required.go
- block_overlap.go
- calendar_duplicate_dates.go
- desc_equals_name.go
- duplicate_route_name.go
- entity_duplicate.go
- fast_travel.go
- frequency_duration.go
- frequency_overlap.go
- inconsistent_language.go
- inconsistent_timezone.go
- insufficient_color_contrast.go
- insufficient_service.go
- invalid_email.go
- invalid_farezone.go
- invalid_parent_station.go
- invalid_phone_number.go
- invalid_url.go
- min_transfer_time.go
- no_scheduled_service.go
- null_island.go
- repeated_stop_times.go
- rider_category_id_required.go
- route_extended_types_warning.go
- route_long_short_name.go
- route_name_characters.go
- route_names_prefix.go
- rules.go
- service_all_days_empty.go
- short_service.go
- stop_time_sequence.go
- stop_too_close.go
- stop_too_far.go
- too_far_from_shape.go
- unused_entity.go