Versions in this module Expand all Collapse all v1 v1.1.0 Nov 27, 2022 v1.0.0 Nov 27, 2022 Changes in this version + const OSM_INDEX_SCALE + const VITERBI2_GRANULARITY + const VITERBI2_MODE + const VITERBI2_SIGMA + const VITERBI2_START_TOLERANCE + const VITERBI2_THREADS + const VITERBI_NORMALIZE_DELTA + const VITERBI_SIGMA + var HIGHWAY_BLACKLIST []string = []string + func CreateSVG(fname string, elements [][]Boundable, options SVGOptions) error + func DecodeOSM(path string, options OSMOptions, f func(v interface{})) error + func DrawLineOnCells(startX int, startY int, endX int, endY int, maxX int, maxY int) [][2]int + func IsOSMBlacklisted(highway string) bool + func IsOSMBlacklistedWithList(highway string, blacklist []string) bool + func KDE(traces Traces, cellSize float64, sigma float64) [][]float64 + func NormalizeTraces(traces []*Trace) + func RtreegoRect(r Rectangle) *rtreego.Rect + func SaveChicagoTraces(tracePath string, traces Traces) error + func SaveKharitaTraces(fname string, traces Traces) error + func SaveTraces(tracePath string, traces Traces) error + func VisualizeGraphs(scale float64, fname string, graphs []*Graph, traces []*Trace) error + func Viterbi(graph *Graph, traces []*Trace, tolerance float64) + func Viterbi2(traces []*Trace, graph *Graph, opts Viterbi2Options) (edgeHits map[int]int) + type AstarParams struct + MaxDistance float64 + type Boundable interface + Bounds func() Rectangle + type CMTOptions struct + CheckFunc func(tripID int, t time.Time, p Point, speed float64, heading float64) bool + Limit int + SetMetadata bool + TimeBreak time.Duration + type ColoredBoundable struct + Boundable Boundable + Color string + func (b ColoredBoundable) Bounds() Rectangle + type Edge struct + Dst *Node + ID int + Src *Node + func (edge *Edge) AngleTo(other *Edge) float64 + func (edge *Edge) ClosestPos(point Point) EdgePos + func (edge *Edge) GetOpposite() *Edge + func (edge *Edge) IsAdjacent(other *Edge) bool + func (edge *Edge) Segment() Segment + func (edge *Edge) String() string + func (edge *Edge) Vector() Point + type EdgePos struct + Edge *Edge + Position float64 + func (ep EdgePos) Point() Point + type EmbeddedImage struct + Dst Point + Image string + Src Point + func (img EmbeddedImage) Bounds() Rectangle + type FollowParams struct + Backwards bool + Distance float64 + NoForwards bool + SeenNodes map[int]bool + SourceNodes []*Node + SourcePos EdgePos + StopNodes map[int]bool + type Graph struct + Edges []*Edge + Nodes []*Node + func GraphFromEdges(edges []*Edge) *Graph + func LoadOSM(path string, bounds Rectangle) (*Graph, error) + func LoadOSMMultiple(path string, regions []Rectangle, options OSMOptions) ([]*Graph, error) + func LoadOSMMultiple2(path string, regions []Rectangle, options OSMOptions) ([]*Graph, error) + func ReadAhmedMap(verticesFname string, edgesFname string) (*Graph, error) + func ReadChicagoMap(fname string) (*Graph, error) + func ReadDaviesMap(verticesFname string, edgesFname string) (*Graph, error) + func ReadEdelkampMap(fname string) (*Graph, error) + func ReadGraph(fname string) (*Graph, error) + func ReadKharitaMap(fname string) (*Graph, error) + func (graph *Graph) AddBidirectionalEdge(v1 *Node, v2 *Node) [2]*Edge + func (graph *Graph) AddEdge(src *Node, dst *Node) *Edge + func (graph *Graph) AddNode(point Point) *Node + func (graph *Graph) Astar(src *Node, dst *Node, params AstarParams) ShortestPathResult + func (graph *Graph) Bounds() Rectangle + func (graph *Graph) Clone() *Graph + func (graph *Graph) FilterEdges(badEdges map[int]bool) *Graph + func (graph *Graph) FilterEdgesWithMaps(badEdges map[int]bool) (*Graph, map[int]*Node, map[int]*Edge) + func (graph *Graph) FindEdge(src *Node, dst *Node) *Edge + func (graph *Graph) Follow(params FollowParams) []EdgePos + func (graph *Graph) GetRoadSegmentGraph() (*Graph, map[int]RoadSegment, map[int]*Node) + func (graph *Graph) GetRoadSegments() []RoadSegment + func (graph *Graph) GetSubgraphInRect(r Rectangle) *Graph + func (graph *Graph) GridIndex(gridSize float64) GraphGridIndex + func (graph *Graph) LonLatToMeters(origin Point) + func (graph *Graph) MakeBidirectional() + func (graph *Graph) MetersToLonLat(origin Point) + func (graph *Graph) Rtree() Rtree + func (graph *Graph) ShortestDistancesFromSource(src *Node) map[int]float64 + func (graph *Graph) ShortestPath(src *Node, params ShortestPathParams) ShortestPathResult + func (graph *Graph) SplitEdge(edge *Edge, length float64) *Edge + func (graph *Graph) Write(fname string) error + type GraphGridIndex struct + func (idx GraphGridIndex) Search(rect Rectangle) []*Edge + type GridIndex struct + func NewGridIndex(gridSize float64) *GridIndex + func (idx GridIndex) Insert(id int, rect Rectangle) + func (idx GridIndex) Search(rect Rectangle) []int + type Line struct + A Point + B Point + func (line Line) ProjectPoint(point Point) Point + type Node struct + ID int + In []*Edge + Out []*Edge + Point Point + func (node *Node) RemoveEdge(edge *Edge) + func (node *Node) String() string + type OSMOptions struct + Bytes []byte + CustomBlacklist []string + CustomWhitelist []string + EdgeTags []map[int]map[string]string + EdgeWidths []map[int]float64 + IncludeRailway bool + LayerEdges []map[int]bool + MotorwayEdges []map[int]bool + NoParking bool + NoTunnels bool + NodeTags []map[int]map[string]string + OneWay bool + OnlyMotorways bool + TunnelEdges []map[int]bool + Verbose bool + type Observation struct + Metadata map[string]interface{} + Point Point + Time time.Time + func (obs *Observation) GetMetadata(k string) interface{} + func (obs *Observation) SetMetadata(k string, val interface{}) + type Point struct + X float64 + Y float64 + func RDP(points []Point, epsilon float64) []Point + func (point Point) Add(other Point) Point + func (point Point) AngleTo(other Point) float64 + func (point Point) Bounds() Rectangle + func (point Point) Cross(other Point) float64 + func (point Point) Distance(other Point) float64 + func (point Point) Dot(other Point) float64 + func (point Point) LonLatToMeters(origin Point) Point + func (point Point) Magnitude() float64 + func (point Point) MetersToLonLat(origin Point) Point + func (point Point) MulPairwise(other Point) Point + func (point Point) Rectangle() Rectangle + func (point Point) RectangleTol(tol float64) Rectangle + func (point Point) Scale(f float64) Point + func (point Point) SignedAngle(other Point) float64 + func (point Point) Sub(other Point) Point + type Polygon []Point + func GetConvexHull(points []Point) Polygon + func (poly Polygon) Bounds() Rectangle + func (poly Polygon) Contains(p Point) bool + func (poly Polygon) Distance(p Point) float64 + func (poly Polygon) SegmentIntersections(segment Segment) []Point + func (poly Polygon) Segments() []Segment + type Rectangle struct + Max Point + Min Point + var EmptyRectangle Rectangle = Rectangle{ ... } + func Rect(sx, sy, ex, ey float64) Rectangle + func (rect Rectangle) AddTol(tol float64) Rectangle + func (rect Rectangle) Area() float64 + func (rect Rectangle) Bounds() Rectangle + func (rect Rectangle) Center() Point + func (rect Rectangle) Contains(point Point) bool + func (rect Rectangle) ContainsRect(other Rectangle) bool + func (rect Rectangle) Diagonal() float64 + func (rect Rectangle) Extend(point Point) Rectangle + func (rect Rectangle) ExtendRect(other Rectangle) Rectangle + func (rect Rectangle) IOU(other Rectangle) float64 + func (rect Rectangle) Intersection(other Rectangle) Rectangle + func (rect Rectangle) Intersects(other Rectangle) bool + func (rect Rectangle) Lengths() Point + func (rect Rectangle) ToPolygon() Polygon + type RoadSegment struct + EdgeDistances []float64 + Edges []*Edge + ID int + func NewRoadSegment(edges []*Edge) (RoadSegment, error) + func (rs RoadSegment) Bounds() Rectangle + func (rs RoadSegment) ClosestPos(p Point) EdgePos + func (rs RoadSegment) DistanceOfEdge(edge *Edge) float64 + func (rs RoadSegment) DistanceToEdge(t float64) *Edge + func (rs RoadSegment) DistanceToIndex(t float64) int + func (rs RoadSegment) Dst() *Node + func (rs RoadSegment) Length() float64 + func (rs RoadSegment) PosAtFactor(t float64) EdgePos + func (rs RoadSegment) Src() *Node + type Rtree struct + func (rtree Rtree) Search(rect Rectangle) []*Edge + type SVGOptions struct + Blur float64 + Bounds Rectangle + Color string + Scale float64 + ScaleX float64 + ScaleY float64 + Sparse float64 + StrokeWidth float64 + Unflip bool + Zoom float64 + type Segment struct + End Point + Start Point + func (segment Segment) AngleTo(other Segment) float64 + func (segment Segment) Bounds() Rectangle + func (segment Segment) Distance(point Point) float64 + func (segment Segment) DistanceToSegment(other Segment) float64 + func (segment Segment) Intersection(other Segment) *Point + func (segment Segment) Length() float64 + func (segment Segment) Line() Line + func (segment Segment) PointAtFactor(factor float64, normalized bool) Point + func (segment Segment) Project(point Point, normalized bool) float64 + func (segment Segment) ProjectPoint(point Point) Point + func (segment Segment) ProjectWithWidth(point Point, width float64) Point + func (segment Segment) Sample(d float64) []Point + func (segment Segment) Vector() Point + type ShortestPathParams struct + EdgeLengths map[int]float64 + MaxDistance float64 + StopNodes []*Node + func (params ShortestPathParams) IsStopNode(node *Node) bool + type ShortestPathResult struct + Backpointers map[int]int + Distances map[int]float64 + Remaining map[int]bool + func (result ShortestPathResult) GetFullPathTo(node *Node) []*Node + func (result ShortestPathResult) GetPathTo(node *Node) []*Node + type SvgLabel struct + Point Point + Text string + func (b SvgLabel) Bounds() Rectangle + type Trace struct + Name string + Observations []*Observation + func (trace *Trace) LastObservation() *Observation + func (trace *Trace) LonLatToMeters(origin Point) + type Traces []*Trace + func LoadCMTTraces(tracePath string, rect *Rectangle, options CMTOptions) (Traces, error) + func LoadCartelTraces(tracePath string) (Traces, error) + func LoadChicagoTraces(tracePath string) (Traces, error) + func LoadTraces(tracePath string) (Traces, error) + func (traces Traces) Bounds() Rectangle + func (traces Traces) LonLatToMeters(origin Point) + type Viterbi2Options struct + EdgeWeights map[int]float64 + Granularity float64 + HitsOnly bool + NewMode bool + Output map[int][]EdgePos + Sigma float64 + StartTolerance float64 + Threads int + func (opts Viterbi2Options) GetGranularity() float64 + func (opts Viterbi2Options) GetSigma() float64 + func (opts Viterbi2Options) GetStartTolerance() float64 + func (opts Viterbi2Options) GetThreads() int + type WeightedBoundable struct + Boundable Boundable + Weight float64 + func (wb WeightedBoundable) Bounds() Rectangle + type WidthBoundable struct + Boundable Boundable + Width float64 + func (b WidthBoundable) Bounds() Rectangle + type WrappingBoundable interface + Unwrap func() Boundable