Documentation ¶
Index ¶
- Variables
- func FloatEquals(a float32, b float32, e float32) bool
- func GetActDays(service *gtfs.Service) int
- func MaxParallelism() int
- type AdjacentStopTimeGrouper
- type AgencyDuplicateRemover
- type BySimi
- type ClusterCand
- type CompleteTripsGeoFilter
- type DateRange
- type DayType
- type FrequencyMinimizer
- type IDMinimizer
- type Item
- type OrphanRemover
- type Overlap
- type PlatformCodeDropper
- type PriorityQueue
- type Processor
- type RouteDuplicateRemover
- type ServiceCalDatesRem
- type ServiceCompressed
- type ServiceDuplicateRemover
- type ServiceMinimizer
- type ServiceNonOverlapper
- type ShapeDuplicateRemover
- type ShapeIdx
- type ShapeMinimizer
- type ShapeRemeasurer
- type ShapeSnapper
- type StopCluster
- type StopClusterIdx
- type StopDuplicateRemover
- type StopParentAverager
- type StopParentEnforcer
- type StopReclusterer
- type TooFastTripRemover
- type TripDuplicateRemover
Constants ¶
This section is empty.
Variables ¶
var DEG_TO_RAD float64 = 0.017453292519943295769236907684886127134428718885417254560
var DEG_TO_RAD32 float32 = float32(DEG_TO_RAD)
Functions ¶
func FloatEquals ¶
FloatEquals checks if the difference of two floats is smaller than epsilon
func GetActDays ¶
GetActDays returns the number of active days of a gtfs.Service
func MaxParallelism ¶
func MaxParallelism() int
MaxParallelism returns the number of CPUs, or the maximum number of processes if the latter is smaller than the former
Types ¶
type AdjacentStopTimeGrouper ¶
type AdjacentStopTimeGrouper struct { }
AdjacentStopTimeGrouper groups adjacent stop times with the same stop (this can happen if arrival and departure are modelled as separate stop events)
func (AdjacentStopTimeGrouper) Run ¶
func (m AdjacentStopTimeGrouper) Run(feed *gtfsparser.Feed)
Run the FrequencyMinimizer on a feed
type AgencyDuplicateRemover ¶
type AgencyDuplicateRemover struct { }
AgencyDuplicateRemover merges semantically equivalent routes
func (AgencyDuplicateRemover) Run ¶
func (adr AgencyDuplicateRemover) Run(feed *gtfsparser.Feed)
Run this AgencyDuplicateRemover on some feed
type BySimi ¶
type BySimi []ClusterCand
BySimi implements sort.Interface for []ClusterCand based on the similarity (bigger = first)
type ClusterCand ¶
type ClusterCand struct {
// contains filtered or unexported fields
}
Merge cluster candidate with cluster id and similarity score [0, 1]
type CompleteTripsGeoFilter ¶
type CompleteTripsGeoFilter struct {
Polygons []gtfsparser.Polygon
}
StopDuplicateRemover merges semantically equivalent stops
func (CompleteTripsGeoFilter) Run ¶
func (f CompleteTripsGeoFilter) Run(feed *gtfsparser.Feed)
Run this StopDuplicateRemover on some feed
type DateRange ¶
DateRange specified a date range from Start to End
func GetDateRange ¶
GetDateRange returns the active date range of a gtfs.Service
type FrequencyMinimizer ¶
FrequencyMinimizer minimizes trips, stop_times and frequencies by searching optimal covers for trip times.
func (FrequencyMinimizer) Run ¶
func (m FrequencyMinimizer) Run(feed *gtfsparser.Feed)
Run the FrequencyMinimizer on a feed
type IDMinimizer ¶
type IDMinimizer struct { Prefix string Base int KeepStations bool KeepBlocks bool KeepTrips bool KeepRoutes bool KeepFares bool KeepShapes bool KeepLevels bool KeepServices bool KeepAgencies bool KeepPathways bool KeepAttributions bool }
IDMinimizer minimizes IDs by replacing them be continuous integer
func (IDMinimizer) Run ¶
func (minimizer IDMinimizer) Run(feed *gtfsparser.Feed)
Run this IDMinimizer on a feed
type OrphanRemover ¶
type OrphanRemover struct { }
OrphanRemover removes entities that aren't referenced anywhere
func (OrphanRemover) Run ¶
func (or OrphanRemover) Run(feed *gtfsparser.Feed)
Run the OrphanRemover on some feed
type PlatformCodeDropper ¶
type PlatformCodeDropper struct { }
PlatformCodeDropper removes platform codes from stops without a parent
func (PlatformCodeDropper) Run ¶
func (sdr PlatformCodeDropper) Run(feed *gtfsparser.Feed)
Run this PlatformCodeDropper on some feed
type PriorityQueue ¶
A PriorityQueue implements heap.Interface and holds Items.
func NewPriorityQueue ¶
func NewPriorityQueue(len int) PriorityQueue
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
type Processor ¶
type Processor interface {
Run(*gtfsparser.Feed)
}
Processor modifies an existing GTFS feed in-place
type RouteDuplicateRemover ¶
type RouteDuplicateRemover struct { }
RouteDuplicateRemover merges semantically equivalent routes
func (RouteDuplicateRemover) Run ¶
func (rdr RouteDuplicateRemover) Run(feed *gtfsparser.Feed)
Run this RouteDuplicateRemover on some feed
type ServiceCalDatesRem ¶
type ServiceCalDatesRem struct { ServiceMinimizer // contains filtered or unexported fields }
ServiceCalDatesRemover removes any entry in calendar_dates.txt by splitting services into continuous blocks
func (ServiceCalDatesRem) Run ¶
func (sm ServiceCalDatesRem) Run(feed *gtfsparser.Feed)
Run this ServiceMinimizer on some feed
type ServiceCompressed ¶
type ServiceCompressed struct {
// contains filtered or unexported fields
}
type ServiceDuplicateRemover ¶
type ServiceDuplicateRemover struct { }
ServiceDuplicateRemover removes duplicate services. Services are considered equal if they resolve to exactly the same service dates
func (ServiceDuplicateRemover) Run ¶
func (sdr ServiceDuplicateRemover) Run(feed *gtfsparser.Feed)
Run this ServiceDuplicateRemover on some feed
type ServiceMinimizer ¶
type ServiceMinimizer struct { }
ServiceMinimizer minimizes services by finding optimal calendar.txt and calendar_dates.txt coverages.
func (ServiceMinimizer) Run ¶
func (sm ServiceMinimizer) Run(feed *gtfsparser.Feed)
Run this ServiceMinimizer on some feed
type ServiceNonOverlapper ¶
ServiceNonOverlapper constructs day-wise non-overlapping trips. Basically, this works as follows: uniqe day types are constructed for each day of the week. A day type is one DOW on which *excactly* the same trips are served. Similary day types are than aggreated, and outfitted with an ID "<Weekday> (WW<list of calendar weeks served)".
func (ServiceNonOverlapper) Run ¶
func (sm ServiceNonOverlapper) Run(feed *gtfsparser.Feed)
Run this ServiceMinimizer on some feed
type ShapeDuplicateRemover ¶
type ShapeDuplicateRemover struct { MaxEqDist float64 // contains filtered or unexported fields }
ShapeDuplicateRemover removes duplicate shapes
func (ShapeDuplicateRemover) Run ¶
func (sdr ShapeDuplicateRemover) Run(feed *gtfsparser.Feed)
Run this ShapeDuplicateRemover on some feed
type ShapeIdx ¶
type ShapeIdx struct {
// contains filtered or unexported fields
}
ShapeIdx stores objects for fast nearest-neighbor retrieval
func NewShapeIdx ¶
type ShapeMinimizer ¶
type ShapeMinimizer struct {
Epsilon float64
}
ShapeMinimizer minimizes shapes.
func (ShapeMinimizer) Run ¶
func (sm ShapeMinimizer) Run(feed *gtfsparser.Feed)
Run this ShapeMinimizer on some feed
type ShapeRemeasurer ¶
type ShapeRemeasurer struct { }
ShapeRemeasurer remeasure shapes
func (ShapeRemeasurer) Run ¶
func (s ShapeRemeasurer) Run(feed *gtfsparser.Feed)
Run this ShapeRemeasurer on some feed
type ShapeSnapper ¶
type ShapeSnapper struct { MaxDist float64 // contains filtered or unexported fields }
ShapeMinimizer minimizes shapes.
func (ShapeSnapper) Run ¶
func (sm ShapeSnapper) Run(feed *gtfsparser.Feed)
Run this ShapeMinimizer on some feed
type StopCluster ¶
A StopCluster contains stops in .Childs which are grouped by stops in in .Parents (all stops in .Parents have location_type = 1). If a StopCluster contains multiple parents, the best matching parent will be chosen later on
func NewStopCluster ¶
func NewStopCluster(stop *gtfs.Stop) *StopCluster
Create a new StopCluster from a single stops
type StopClusterIdx ¶
type StopClusterIdx struct {
// contains filtered or unexported fields
}
StopClusterIdx stores objects for fast nearest-neighbor retrieval
func NewStopClusterIdx ¶
func NewStopClusterIdx(clusters []*StopCluster, cellWidth, cellHeight float64) *StopClusterIdx
func (*StopClusterIdx) GetNeighbors ¶
func (gi *StopClusterIdx) GetNeighbors(excludeCid int, c *StopCluster, d float64) map[int]bool
func (*StopClusterIdx) GetNeighborsByLatLon ¶
type StopDuplicateRemover ¶
type StopDuplicateRemover struct { DistThresholdStop float64 DistThresholdStation float64 Fuzzy bool }
StopDuplicateRemover merges semantically equivalent stops
func (StopDuplicateRemover) Run ¶
func (sdr StopDuplicateRemover) Run(feed *gtfsparser.Feed)
Run this StopDuplicateRemover on some feed
type StopParentAverager ¶
type StopParentAverager struct {
MaxDist float64
}
StopParentAverager takes stop parents that are more than MaxDist meter away from one of their childs and checks whether moving them to the centroid of all childs fixes this. If not, nothing is changed!
func (StopParentAverager) Run ¶
func (sdr StopParentAverager) Run(feed *gtfsparser.Feed)
Run this StopParentEnforcer on some feed
type StopParentEnforcer ¶
type StopParentEnforcer struct { }
StopParentEnforcer makes sure that all stops have parents
func (StopParentEnforcer) Run ¶
func (sdr StopParentEnforcer) Run(feed *gtfsparser.Feed)
Run this StopParentEnforcer on some feed
type StopReclusterer ¶
type StopReclusterer struct { DistThreshold float64 NameSimiThreshold float64 GridCellSize float64 // contains filtered or unexported fields }
StopReclusterer reclusters stops
func (StopReclusterer) Run ¶
func (m StopReclusterer) Run(feed *gtfsparser.Feed)
Run this StopReclusterer on some feed
type TooFastTripRemover ¶
type TooFastTripRemover struct { }
StopDuplicateRemover merges semantically equivalent stops
func (TooFastTripRemover) Run ¶
func (f TooFastTripRemover) Run(feed *gtfsparser.Feed)
Run this StopDuplicateRemover on some feed
type TripDuplicateRemover ¶
type TripDuplicateRemover struct { Fuzzy bool Aggressive bool MaxDayDist int // contains filtered or unexported fields }
TripDuplicateRemover merges semantically equivalent routes
func (TripDuplicateRemover) Run ¶
func (m TripDuplicateRemover) Run(feed *gtfsparser.Feed)
Source Files ¶
- adjstoptimegrouper.go
- agencyduplicateremover.go
- completegeotripsfilter.go
- frequencyminizer.go
- idminimizer.go
- orphanminimizer.go
- parentaverager.go
- platformcodedropper.go
- priorityqueue.go
- processor.go
- routeduplicateremover.go
- servicecaldatesremover.go
- serviceduplicateremover.go
- serviceminimizer.go
- servicenonoverlapper.go
- shapeduplicateremover.go
- shapeidx.go
- shapeminimizer.go
- shaperemeasurer.go
- shapesnapper.go
- stopclusteridx.go
- stopduplicateremover.go
- stopparentenforcer.go
- stopreclusterer.go
- toofasttripremover.go
- tripduplicateremover.go
- util.go