Documentation
¶
Index ¶
- Constants
- func AsFlaggedTimeline(boxes []LatlongTimeBox, start time.Time, flagIndex int) string
- func AsTimeline(boxes []LatlongTimeBox, start time.Time) string
- func CompareBoxSlices(b1, b2 *[]LatlongTimeBox) (overlaps bool, conf float64, str string)
- func CompareBoxSlicesNew(b1, b2 *[]LatlongTimeBox) (overlaps bool, conf float64, str string)
- func CompareBoxSlicesOld(b1, b2 *[]LatlongTimeBox) (overlaps bool, conf float64, str string)
- func HeadingDelta(from, to float64) float64
- func InterpolateHeading(from, to, ratio float64) float64
- func LoggedCompare(nFlips int, tA, tB *[]LatlongTimeBox, iA, iB int, prefix string) (space bool, deb string)
- func NM2KM(nm float64) float64
- func NMph2mps(f float64) float64
- type BoxResult
- type BoxSliceResult
- type ClassBMap
- type ClassBSector
- type Cylinder
- type DebugLog
- type Debugger
- type Float64Range
- type Int64Range
- type Intersector
- type Latlong
- func (from Latlong) BearingTowards(to Latlong) float64
- func (ll Latlong) Box(widthKm, heightKm float64) LatlongBox
- func (from Latlong) BoxTo(to Latlong) LatlongBox
- func (from Latlong) BuildLine(to Latlong) LatlongLine
- func (pos Latlong) Circle(radius float64) LatlongCircle
- func (from Latlong) Dist(to Latlong) float64
- func (from Latlong) Dist3(to Latlong, altitude float64) float64
- func (from Latlong) DistKM(to Latlong) float64
- func (from Latlong) DistNM(to Latlong) float64
- func (from Latlong) Equal(to Latlong) bool
- func (from Latlong) ExactlyEqual(to Latlong) bool
- func (from Latlong) InterpolateTo(to Latlong, ratio float64) Latlong
- func (ll Latlong) IsNil() bool
- func (from Latlong) LatlongDist(to Latlong) float64
- func (from Latlong) LatlongDistSq(to Latlong) float64
- func (pos Latlong) LiesOn(line LatlongLine) bool
- func (from Latlong) LineTo(to Latlong) LatlongLine
- func (at Latlong) MapsUrl() string
- func (from Latlong) MoveKM(heading, distanceKM float64) Latlong
- func (from Latlong) MoveNM(heading, distanceNM float64) Latlong
- func (ll Latlong) Pt() *pmgeo.Point
- func (ll Latlong) String() string
- func (pos Latlong) ToCGIArgs(stem string) string
- func (pos Latlong) Values() url.Values
- type LatlongBox
- func (box LatlongBox) BottomSide() LatlongLine
- func (box LatlongBox) Center() Latlong
- func (box LatlongBox) Contains(pos Latlong) bool
- func (box LatlongBox) ContainsPoint(pos Latlong) bool
- func (box *LatlongBox) Enclose(pos Latlong)
- func (box LatlongBox) IntersectsAltitude(alt int64) bool
- func (b1 LatlongBox) IntersectsBox(b2 LatlongBox) bool
- func (box LatlongBox) IntersectsLine(l LatlongLine) bool
- func (box LatlongBox) IntersectsLineDeb(l LatlongLine) (bool, string)
- func (box LatlongBox) IsNil() bool
- func (box LatlongBox) LatHeight() float64
- func (box LatlongBox) LatRange() Float64Range
- func (box LatlongBox) LeftSide() LatlongLine
- func (box LatlongBox) LongRange() Float64Range
- func (box LatlongBox) LongWidth() float64
- func (box LatlongBox) LookForExit() bool
- func (box LatlongBox) NW() Latlong
- func (box LatlongBox) OverlapsLine(l LatlongLine) OverlapOutcome
- func (b1 LatlongBox) OverlapsWith(b2 LatlongBox) (OverlapOutcome, float64)
- func (box LatlongBox) RightSide() LatlongLine
- func (box LatlongBox) SE() Latlong
- func (box LatlongBox) String() string
- func (box LatlongBox) ToCGIArgs(stem string) string
- func (c LatlongBox) ToCircles() []LatlongCircle
- func (b LatlongBox) ToLines() []LatlongLine
- func (box LatlongBox) TopSide() LatlongLine
- type LatlongCircle
- func (c LatlongCircle) ContainsPoint(pos Latlong) bool
- func (c LatlongCircle) IntersectsAltitude(alt int64) bool
- func (c LatlongCircle) IntersectsBox(b2 LatlongBox) bool
- func (c LatlongCircle) IntersectsLine(l LatlongLine) bool
- func (c LatlongCircle) IntersectsLineDeb(l LatlongLine) (bool, string)
- func (c LatlongCircle) LookForExit() bool
- func (c LatlongCircle) String() string
- func (c LatlongCircle) ToCircles() []LatlongCircle
- func (c LatlongCircle) ToLines() []LatlongLine
- type LatlongLine
- func (l LatlongLine) Bound() *pmgeo.Bound
- func (l LatlongLine) Box() LatlongBox
- func (line LatlongLine) ClosestDistance(pos Latlong) float64
- func (line LatlongLine) ClosestTo(pos Latlong) Latlong
- func (line LatlongLine) DistAlongLine(pos Latlong) float64
- func (l1 LatlongLine) Intersects(l2 LatlongLine) (Latlong, bool)
- func (l1 LatlongLine) IntersectsUnbounded(l2 LatlongLine) (Latlong, bool)
- func (l LatlongLine) IsDegenerate() bool
- func (l LatlongLine) IsVertical() bool
- func (l LatlongLine) Ln() *pmgeo.Line
- func (orig LatlongLine) PerpendicularTo(pos Latlong) LatlongLine
- func (line LatlongLine) String() string
- func (ln LatlongLine) ToCGIArgs(stem string) string
- func (ln LatlongLine) Values() url.Values
- func (l LatlongLine) WhichSide(p Latlong) int
- type LatlongSlice
- type LatlongTimeBox
- func (tb1 LatlongTimeBox) AltitudeSpeedHeadingSimilar(tb2 LatlongTimeBox) bool
- func (tb *LatlongTimeBox) Enclose(p Latlong, t time.Time)
- func (tbox *LatlongTimeBox) EnsureMinSide(min float64)
- func (tb1 LatlongTimeBox) SpaceCompare(tb2 LatlongTimeBox) bool
- func (tbox LatlongTimeBox) String() string
- func (b LatlongTimeBox) TooApproximateForComparison() bool
- type MapRenderer
- type NamedLatlong
- type OverlapOutcome
- type Polygon
- func (poly *Polygon) AddPoint(ll Latlong)
- func (poly *Polygon) ApproxRadiusKM() float64
- func (poly *Polygon) Centroid() Latlong
- func (p *Polygon) Contains(ll Latlong) bool
- func (poly *Polygon) GetPoints() []Latlong
- func (poly *Polygon) GetSides() [][]Latlong
- func (poly *Polygon) IntersectsLine(l LatlongLine) ([]Latlong, bool)
- func (poly *Polygon) OverlapsLine(l LatlongLine) OverlapOutcome
- func (poly *Polygon) String() string
- func (poly *Polygon) ToCircles() []LatlongCircle
- func (poly *Polygon) ToLines() []LatlongLine
- type PolygonRestriction
- func (pr PolygonRestriction) BoundingBox() LatlongBox
- func (pr PolygonRestriction) CanContain() bool
- func (pr PolygonRestriction) IsExclusion() bool
- func (pr PolygonRestriction) IsNil() bool
- func (pr PolygonRestriction) OverlapsAltitude(a int64) OverlapOutcome
- func (pr PolygonRestriction) String() string
- func (pr PolygonRestriction) ToCircles() []LatlongCircle
- func (pr PolygonRestriction) ToLines() []LatlongLine
- type Procedure
- type RangeInterface
- type Restrictor
- type SquareBoxRestriction
- func (sb SquareBoxRestriction) BoundingBox() LatlongBox
- func (sb SquareBoxRestriction) CanContain() bool
- func (sb SquareBoxRestriction) Contains(pos Latlong) bool
- func (sb SquareBoxRestriction) IsExclusion() bool
- func (sb SquareBoxRestriction) IsNil() bool
- func (sb SquareBoxRestriction) OverlapsAltitude(a int64) OverlapOutcome
- func (sb SquareBoxRestriction) OverlapsLine(ln LatlongLine) OverlapOutcome
- func (sb SquareBoxRestriction) String() string
- func (sb SquareBoxRestriction) ToCircles() []LatlongCircle
- func (sb SquareBoxRestriction) ToLines() []LatlongLine
- type TPClassBAnalysis
- type TimeRange
- type VerticalPlaneRestriction
- func (vp VerticalPlaneRestriction) BoundingBox() LatlongBox
- func (vp VerticalPlaneRestriction) CanContain() bool
- func (vp VerticalPlaneRestriction) Contains(pos Latlong) bool
- func (vp VerticalPlaneRestriction) IsExclusion() bool
- func (vp VerticalPlaneRestriction) IsNil() bool
- func (vp VerticalPlaneRestriction) OverlapsAltitude(a int64) OverlapOutcome
- func (vp VerticalPlaneRestriction) OverlapsLine(ln LatlongLine) OverlapOutcome
- func (vp VerticalPlaneRestriction) String() string
- func (vp VerticalPlaneRestriction) ToCircles() []LatlongCircle
- func (vp VerticalPlaneRestriction) ToLines() []LatlongLine
- type Waypoint
- type Window
- func (w Window) IntersectsAltitude(alt int64) bool
- func (w Window) IntersectsLine(l LatlongLine) bool
- func (w Window) IntersectsLineDeb(l LatlongLine) (bool, string)
- func (w Window) LookForExit() bool
- func (w Window) String() string
- func (w Window) ToCircles() []LatlongCircle
- func (w Window) ToLines() []LatlongLine
Constants ¶
const ( KFeetPerKM = float64(3280.8399) KNauticalMilePerKM = float64(0.539957) )
const EPSILON float64 = 0.0000001
const KLineSnapKM = 0.3 // How far a trackpoint can be from a line, and still be on that line
Variables ¶
This section is empty.
Functions ¶
func AsFlaggedTimeline ¶
func AsFlaggedTimeline(boxes []LatlongTimeBox, start time.Time, flagIndex int) string
func AsTimeline ¶
func AsTimeline(boxes []LatlongTimeBox, start time.Time) string
func CompareBoxSlices ¶
func CompareBoxSlices(b1, b2 *[]LatlongTimeBox) (overlaps bool, conf float64, str string)
func CompareBoxSlicesNew ¶
func CompareBoxSlicesNew(b1, b2 *[]LatlongTimeBox) (overlaps bool, conf float64, str string)
overlaps: if we should consider them the same thing conf: how confident we are str: some debug text about it.
func CompareBoxSlicesOld ¶
func CompareBoxSlicesOld(b1, b2 *[]LatlongTimeBox) (overlaps bool, conf float64, str string)
overlaps: if we should consider them the same thing conf: how confident we are str: some debug text about it.
func HeadingDelta ¶
func InterpolateHeading ¶
func LoggedCompare ¶
Types ¶
type BoxResult ¶
type BoxResult struct {
NumTimeOverlaps int // How many boxes, from the other track, overlapped in time
NumTimeSpaceOverlaps int // How many boxes, from the other track, overlapped in time and space
NumIgnores int // How many comparisons we ignored, because of sketchy interpolation
TimeOverlapIndices []int // Which boxes from the other track we have Time-only overlaps
}
type BoxSliceResult ¶
type BoxSliceResult struct {
B []BoxResult
NumBoxes int
NumBoxesJustTimeOverlap int
NumBoxesTimeSpaceOverlap int
NumBoxesIgnored int
BadBoxIndices []int // For debugging; which boxes had just time overlap
BadBoxOtherIndices [][]int // And for each such box, which boxes in other track it messed
}
func NewResults ¶
func NewResults(b *[]LatlongTimeBox) BoxSliceResult
func (*BoxSliceResult) Finalize ¶
func (r *BoxSliceResult) Finalize()
func (BoxSliceResult) String ¶
func (r BoxSliceResult) String() string
type ClassBMap ¶
type ClassBMap struct {
Sectors []ClassBSector // Must be ordered by asc StartBearing, and support wraparound
Center Latlong
Name string
}
func (ClassBMap) ClassBPointAnalysis ¶
func (m ClassBMap) ClassBPointAnalysis(pos Latlong, speed float64, alt, tol float64, o *TPClassBAnalysis)
func (ClassBMap) ClassBRange ¶
ClassBRange works out if a position is within range of the given map; and if so, what the altitude limits are at that position.
type ClassBSector ¶
type ClassBSector struct {
StartBearing int // Magnetic bearing (-13.68 to get to magnetic @ SFO)
EndBearing int
Steps []Cylinder // Ordered by asc DistanceNM
}
Each sector is a pie wedge, with consistent floor/ceil cylinders
type Debugger ¶
type Debugger interface {
Debugf(format string, args ...interface{})
GetDebug() string // Will delete it.
}
Debugger lets things build debug logs
type Float64Range ¶
type Float64Range struct {
U, V float64
}
func (Float64Range) End ¶
func (r Float64Range) End() float64
func (Float64Range) Start ¶
func (r Float64Range) Start() float64
type Int64Range ¶
type Int64Range struct {
U, V int64
}
func (Int64Range) End ¶
func (r Int64Range) End() float64
func (Int64Range) Start ¶
func (r Int64Range) Start() float64
type Intersector ¶
type Intersector interface {
MapRenderer
Debugger
BoundingBox() LatlongBox // 2D bounding box for intersection
CanContain() bool // Will be false for window intersections
Contains(Latlong) bool
OverlapsLine(LatlongLine) OverlapOutcome
OverlapsAltitude(int64) OverlapOutcome // DisjointR2ComesAfter == val was above the GR
}
type Latlong ¶
func FormValueLatlong ¶
If fields absent or blank, returns {0.0, 0.0}
func LatlongFromPt ¶
func NewLatlong ¶
Recognizes some common formats:
[36.7415306, -121.8942333] - google maps style full decimals
[36°57'02.96"N, 121°57'09.62"W] - traditional degrees / minutes / seconds
[365702.96N / 1215709.62W] - FAA style concatenated ("DEG"+"MIN"+"SEC.00")
[37-10-35.680N / 122-00-29.950W] - from fltplan.com
returns a nil latlong upon parse failure
func (Latlong) BearingTowards ¶
func (Latlong) Box ¶
func (ll Latlong) Box(widthKm, heightKm float64) LatlongBox
Returns a box, centred on ll, that is of size (width,height)
func (Latlong) BoxTo ¶
func (from Latlong) BoxTo(to Latlong) LatlongBox
func (Latlong) BuildLine ¶
func (from Latlong) BuildLine(to Latlong) LatlongLine
func (Latlong) Circle ¶
func (pos Latlong) Circle(radius float64) LatlongCircle
func (Latlong) ExactlyEqual ¶
This probably isn't what you want
func (Latlong) IsNil ¶
Maybe it's safe to compare a nil-float64 directly to 0.0, and this is just a paranoid bodge.
func (Latlong) LatlongDist ¶
ApproxDist treats the latlongs as y,x coords, and returns the 'latlong dist'
func (Latlong) LatlongDistSq ¶
The square of the distance; useful for deciding closest approach
func (Latlong) LiesOn ¶
func (pos Latlong) LiesOn(line LatlongLine) bool
func (Latlong) LineTo ¶
func (from Latlong) LineTo(to Latlong) LatlongLine
type LatlongBox ¶
type LatlongBox struct {
SW, NE Latlong
Floor, Ceil int64 // altitude, feet; zero means "don't care". Nonzero means >= or <=, depending
}
func FormValueLatlongBox ¶
func FormValueLatlongBox(r *http.Request, stem string) LatlongBox
If fields absent or blank, returns {0.0, 0.0} -> {0.0, 0.0}
func LatlongBoxFromBound ¶
func LatlongBoxFromBound(b *pmgeo.Bound) LatlongBox
func (LatlongBox) BottomSide ¶
func (box LatlongBox) BottomSide() LatlongLine
Derive bounded lines for the sides
func (LatlongBox) Center ¶
func (box LatlongBox) Center() Latlong
func (LatlongBox) Contains ¶
func (box LatlongBox) Contains(pos Latlong) bool
func (LatlongBox) ContainsPoint ¶
func (box LatlongBox) ContainsPoint(pos Latlong) bool
Implement Region interface (defunct ?)
func (*LatlongBox) Enclose ¶
func (box *LatlongBox) Enclose(pos Latlong)
Enclose increases the sixe of the box to include the point, if it doesn't fit
func (LatlongBox) IntersectsAltitude ¶
func (box LatlongBox) IntersectsAltitude(alt int64) bool
func (LatlongBox) IntersectsBox ¶
func (b1 LatlongBox) IntersectsBox(b2 LatlongBox) bool
func (LatlongBox) IntersectsLine ¶
func (box LatlongBox) IntersectsLine(l LatlongLine) bool
func (box LatlongBox)IntersectsLine(l LatlongLine) bool {
// Trivial bounding box test; discard if the line (as a box) has no overlap
if !box.IntersectsBox(l.Box()) { return false }
// If the box contains either point, we're good.
if box.Contains(l.From) || box.Contains(l.To) { return true }
// Else: we know the boxes overlap, but both line points are outside of it; so ensure
// that the line has a (bounded) intersection with the box.
if _,isect := box.BottomSide().Intersects(l); isect { return true }
if _,isect := box.LeftSide().Intersects(l); isect { return true }
if _,isect := box.RightSide().Intersects(l); isect { return true }
if _,isect := box.TopSide().Intersects(l); isect { return true }
return false
}
func (LatlongBox) IntersectsLineDeb ¶
func (box LatlongBox) IntersectsLineDeb(l LatlongLine) (bool, string)
func (LatlongBox) IsNil ¶
func (box LatlongBox) IsNil() bool
func (LatlongBox) LatHeight ¶
func (box LatlongBox) LatHeight() float64
func (LatlongBox) LatRange ¶
func (box LatlongBox) LatRange() Float64Range
func (LatlongBox) LeftSide ¶
func (box LatlongBox) LeftSide() LatlongLine
func (LatlongBox) LongRange ¶
func (box LatlongBox) LongRange() Float64Range
func (LatlongBox) LongWidth ¶
func (box LatlongBox) LongWidth() float64
func (LatlongBox) LookForExit ¶
func (box LatlongBox) LookForExit() bool
Implement the Restrictor interface
func (LatlongBox) NW ¶
func (box LatlongBox) NW() Latlong
func (LatlongBox) OverlapsLine ¶
func (box LatlongBox) OverlapsLine(l LatlongLine) OverlapOutcome
func (LatlongBox) OverlapsWith ¶
func (b1 LatlongBox) OverlapsWith(b2 LatlongBox) (OverlapOutcome, float64)
Returned float *should* be the fraction of b1 that overlaps with b2
func (LatlongBox) RightSide ¶
func (box LatlongBox) RightSide() LatlongLine
func (LatlongBox) String ¶
func (box LatlongBox) String() string
func (LatlongBox) ToCGIArgs ¶
func (box LatlongBox) ToCGIArgs(stem string) string
func (LatlongBox) ToCircles ¶
func (c LatlongBox) ToCircles() []LatlongCircle
func (LatlongBox) ToLines ¶
func (b LatlongBox) ToLines() []LatlongLine
Implement MapRenderer interface
func (LatlongBox) TopSide ¶
func (box LatlongBox) TopSide() LatlongLine
type LatlongCircle ¶
func (LatlongCircle) ContainsPoint ¶
func (c LatlongCircle) ContainsPoint(pos Latlong) bool
Implement Region interface (defunct ?)
func (LatlongCircle) IntersectsAltitude ¶
func (c LatlongCircle) IntersectsAltitude(alt int64) bool
func (LatlongCircle) IntersectsBox ¶
func (c LatlongCircle) IntersectsBox(b2 LatlongBox) bool
func (LatlongCircle) IntersectsLine ¶
func (c LatlongCircle) IntersectsLine(l LatlongLine) bool
func (LatlongCircle) IntersectsLineDeb ¶
func (c LatlongCircle) IntersectsLineDeb(l LatlongLine) (bool, string)
func (LatlongCircle) LookForExit ¶
func (c LatlongCircle) LookForExit() bool
Implement GeoRestricter interface
func (LatlongCircle) String ¶
func (c LatlongCircle) String() string
func (LatlongCircle) ToCircles ¶
func (c LatlongCircle) ToCircles() []LatlongCircle
func (LatlongCircle) ToLines ¶
func (c LatlongCircle) ToLines() []LatlongLine
Implement MapRenderer interface
type LatlongLine ¶
type LatlongLine struct {
From, To Latlong
I, J int // index values for the two points used to build this line
// contains filtered or unexported fields
}
Always using two anchor points, and then derive the equation of the line: y = m.x + b
func FormValueLatlongLine ¶
func FormValueLatlongLine(r *http.Request, stem string) LatlongLine
If fields absent or blank, returns {0.0, 0.0} -> {0.0, 0.0}
func LatlongLineFromLn ¶
func LatlongLineFromLn(ln pmgeo.Line) LatlongLine
func (LatlongLine) Bound ¶
func (l LatlongLine) Bound() *pmgeo.Bound
func (LatlongLine) Box ¶
func (l LatlongLine) Box() LatlongBox
func (LatlongLine) ClosestDistance ¶
func (line LatlongLine) ClosestDistance(pos Latlong) float64
func (LatlongLine) ClosestTo ¶
func (line LatlongLine) ClosestTo(pos Latlong) Latlong
Presumes infinite line
func (LatlongLine) DistAlongLine ¶
func (line LatlongLine) DistAlongLine(pos Latlong) float64
If one unit is the dist between .From and .To, and .From is zero; how far along the line is pos?
func (LatlongLine) Intersects ¶
func (l1 LatlongLine) Intersects(l2 LatlongLine) (Latlong, bool)
Returns point of intersection (may be invalid), and bool stating if intersection occurred
func (LatlongLine) IntersectsUnbounded ¶
func (l1 LatlongLine) IntersectsUnbounded(l2 LatlongLine) (Latlong, bool)
Treats the lines as infinite. Returns whether there was an intersection.
func (LatlongLine) IsDegenerate ¶
func (l LatlongLine) IsDegenerate() bool
func (LatlongLine) IsVertical ¶
func (l LatlongLine) IsVertical() bool
func (LatlongLine) Ln ¶
func (l LatlongLine) Ln() *pmgeo.Line
func (LatlongLine) PerpendicularTo ¶
func (orig LatlongLine) PerpendicularTo(pos Latlong) LatlongLine
func (LatlongLine) String ¶
func (line LatlongLine) String() string
func (LatlongLine) ToCGIArgs ¶
func (ln LatlongLine) ToCGIArgs(stem string) string
func (LatlongLine) Values ¶
func (ln LatlongLine) Values() url.Values
func (LatlongLine) WhichSide ¶
func (l LatlongLine) WhichSide(p Latlong) int
-ve == left, +ve == right, 0 == lies-on-line
type LatlongSlice ¶
type LatlongSlice []Latlong
type LatlongTimeBox ¶
type LatlongTimeBox struct {
LatlongBox // embedded
Start, End time.Time
HeadingDelta float64 // How much the heading altered during this box
I, J int // range of indices of trackpoints that generated the box
// These values are used to decide if a box is too approximate to be safe to compare
Source string // too hard to backtrack when debugging, just say so here
Interpolated bool // The box was interpolated, so might be pretty bogus
RunLength int // how many boxes were in this run of interpolation
CentroidHeadingDelta float64 // This is fiddly; see below
Debug string
}
It is a latlong box, with times; used to decide if tracks overlap
func (LatlongTimeBox) AltitudeSpeedHeadingSimilar ¶
func (tb1 LatlongTimeBox) AltitudeSpeedHeadingSimilar(tb2 LatlongTimeBox) bool
func (*LatlongTimeBox) EnsureMinSide ¶
func (tbox *LatlongTimeBox) EnsureMinSide(min float64)
If the box is too narrow or too tall, fatten it out
func (LatlongTimeBox) SpaceCompare ¶
func (tb1 LatlongTimeBox) SpaceCompare(tb2 LatlongTimeBox) bool
Do the boxes overlap in latlong space ?
func (LatlongTimeBox) String ¶
func (tbox LatlongTimeBox) String() string
func (LatlongTimeBox) TooApproximateForComparison ¶
func (b LatlongTimeBox) TooApproximateForComparison() bool
type MapRenderer ¶
type MapRenderer interface {
String() string
ToLines() []LatlongLine
ToCircles() []LatlongCircle
}
MapRenderer lets things output themselves as primitive shapes, to be rendered on a map
type NamedLatlong ¶
NamedLatlong is a Latlong, that happens to have a name (typically a waypoint)
func FormValueNamedLatlong ¶
func (NamedLatlong) IsNil ¶
func (nl NamedLatlong) IsNil() bool
func (NamedLatlong) ShortString ¶
func (nl NamedLatlong) ShortString() string
func (NamedLatlong) String ¶
func (nl NamedLatlong) String() string
func (NamedLatlong) ToCGIArgs ¶
func (nl NamedLatlong) ToCGIArgs(stem string) string
func (NamedLatlong) Values ¶
func (nl NamedLatlong) Values() url.Values
you'll want widget.AddPrefixedValues(v, nl.Values(), "mystem")
type OverlapOutcome ¶
type OverlapOutcome int
const ( Undefined OverlapOutcome = iota // These two apply to linear (range) overlaps (including altitude), where we have an ordering DisjointR2ComesAfter DisjointR2ComesBefore OverlapR2StraddlesStart OverlapR2StraddlesEnd // These two apply to all kinds of overlaps OverlapR2IsContained OverlapR2Contains // This two apply to area overlaps, which don't have an ordering Disjoint OverlapStraddles )
func RangeOverlap ¶
func RangeOverlap(r1, r2 RangeInterface) OverlapOutcome
When they're identical, prefer r1 to contain r2
func (OverlapOutcome) IsContained ¶
func (o OverlapOutcome) IsContained() bool
func (OverlapOutcome) IsDisjoint ¶
func (o OverlapOutcome) IsDisjoint() bool
func (OverlapOutcome) String ¶
func (o OverlapOutcome) String() string
type Polygon ¶
func NewPolygon ¶
func NewPolygon() *Polygon
func (*Polygon) ApproxRadiusKM ¶
Average distance from centroid, in KM.
func (*Polygon) GetSides ¶
A slice of sides, in clockwise order, where each side is represented as a slice of two points {Start, End}
func (*Polygon) IntersectsLine ¶
func (poly *Polygon) IntersectsLine(l LatlongLine) ([]Latlong, bool)
Note; when a line intersects a vertex, it may be found to intersect lines on both sides, and so may contribute that vertex point more than once. So we dedupe.
func (*Polygon) OverlapsLine ¶
func (poly *Polygon) OverlapsLine(l LatlongLine) OverlapOutcome
This is *so* similar to LatlongBox.OverlapsLine ...
func (*Polygon) ToLines ¶
func (poly *Polygon) ToLines() []LatlongLine
type PolygonRestriction ¶
type PolygonRestriction struct {
*Polygon
SideKM float64
AltitudeMin, AltitudeMax int64
IsExcluding bool
Debugger // embed; populate with ptr rcvr e.g. pr.Debugger = new(geo.DebugLog)
}
PolygonRestricton fully implements geo.Restrictor
func (PolygonRestriction) BoundingBox ¶
func (pr PolygonRestriction) BoundingBox() LatlongBox
func (PolygonRestriction) CanContain ¶
func (pr PolygonRestriction) CanContain() bool
func (PolygonRestriction) IsExclusion ¶
func (pr PolygonRestriction) IsExclusion() bool
func (PolygonRestriction) IsNil ¶
func (pr PolygonRestriction) IsNil() bool
func (PolygonRestriction) OverlapsAltitude ¶
func (pr PolygonRestriction) OverlapsAltitude(a int64) OverlapOutcome
func (pr PolygonRestriction)Contains(pos Latlong) bool { return pr.Polygon.Contains(pos) }
func (pr PolygonRestriction)OverlapsLine(ln LatlongLine) OverlapOutcome {
return pr.Box(pr.SideKM,pr.SideKM).OverlapsLine(ln)
}
func (PolygonRestriction) String ¶
func (pr PolygonRestriction) String() string
func (PolygonRestriction) ToCircles ¶
func (pr PolygonRestriction) ToCircles() []LatlongCircle
func (PolygonRestriction) ToLines ¶
func (pr PolygonRestriction) ToLines() []LatlongLine
type Procedure ¶
type Procedure struct {
Name string
Departure bool // If false, is arrival
Airport string // Where we are arriving or departing from
Waypoints []Waypoint
}
A Procedure is a set of waypoints, with altitude / speed guidance, for arrival/departure
func (Procedure) ComparisonLines ¶
func (p Procedure) ComparisonLines() []LatlongLine
ComparisonLines returns the segments of the procedure that a track's boxes need to intersect and align with.
type RangeInterface ¶
type Restrictor ¶
type Restrictor interface {
Intersector
IsExclusion() bool // I.e. the restriction means "do not intersect this thing"
IsNil() bool
}
type SquareBoxRestriction ¶
type SquareBoxRestriction struct {
NamedLatlong // embed
SideKM float64
AltitudeMin, AltitudeMax int64
IsExcluding bool
Debugger // embed; populate with ptr rcvr e.g. sb.Debugger = new(geo.DebugLog)
}
SquareBoxRestricton fully implements geo.Restrictor
func (SquareBoxRestriction) BoundingBox ¶
func (sb SquareBoxRestriction) BoundingBox() LatlongBox
func (SquareBoxRestriction) CanContain ¶
func (sb SquareBoxRestriction) CanContain() bool
func (SquareBoxRestriction) Contains ¶
func (sb SquareBoxRestriction) Contains(pos Latlong) bool
func (SquareBoxRestriction) IsExclusion ¶
func (sb SquareBoxRestriction) IsExclusion() bool
func (SquareBoxRestriction) IsNil ¶
func (sb SquareBoxRestriction) IsNil() bool
func (SquareBoxRestriction) OverlapsAltitude ¶
func (sb SquareBoxRestriction) OverlapsAltitude(a int64) OverlapOutcome
func (SquareBoxRestriction) OverlapsLine ¶
func (sb SquareBoxRestriction) OverlapsLine(ln LatlongLine) OverlapOutcome
func (SquareBoxRestriction) String ¶
func (sb SquareBoxRestriction) String() string
func (SquareBoxRestriction) ToCircles ¶
func (sb SquareBoxRestriction) ToCircles() []LatlongCircle
func (SquareBoxRestriction) ToLines ¶
func (sb SquareBoxRestriction) ToLines() []LatlongLine
type TPClassBAnalysis ¶
type TPClassBAnalysis struct {
// The verdict
WithinRange bool // If we're not within range, the rest has no meaning.
VerticalDisposition int // <0 below; =0 within; >0 above
BelowBy float64 // If below, by how many feet
Reasoning string // Explanation of stuff
// Handy data to have around later
I int // Index into the track for the point we've analyzed
InchesHg float64 // The pressure correction applied
IndicatedAltitude float64 // The pressure corrected altitude
Floor, Ceil float64 // The Class B space the point was in (0 if not in space)
DistNM float64 // Seeing as we've calculated it :)
AllowThisPoint bool // If true, this point is not a violation, regardless of data
}
The output after ClassB analysis of a single position+altitude
func (TPClassBAnalysis) IsViolation ¶
func (a TPClassBAnalysis) IsViolation() bool
type VerticalPlaneRestriction ¶
type VerticalPlaneRestriction struct {
Start, End NamedLatlong
AltitudeMin, AltitudeMax int64
IsExcluding bool
Debugger // embed; populate with ptr rcvr e.g. vp.Debugger = new(geo.DebugLog)
}
VerticalPlane fully implements geo.Restrictor
func (VerticalPlaneRestriction) BoundingBox ¶
func (vp VerticalPlaneRestriction) BoundingBox() LatlongBox
func (VerticalPlaneRestriction) CanContain ¶
func (vp VerticalPlaneRestriction) CanContain() bool
func (VerticalPlaneRestriction) Contains ¶
func (vp VerticalPlaneRestriction) Contains(pos Latlong) bool
func (VerticalPlaneRestriction) IsExclusion ¶
func (vp VerticalPlaneRestriction) IsExclusion() bool
func (VerticalPlaneRestriction) IsNil ¶
func (vp VerticalPlaneRestriction) IsNil() bool
func (VerticalPlaneRestriction) OverlapsAltitude ¶
func (vp VerticalPlaneRestriction) OverlapsAltitude(a int64) OverlapOutcome
func (VerticalPlaneRestriction) OverlapsLine ¶
func (vp VerticalPlaneRestriction) OverlapsLine(ln LatlongLine) OverlapOutcome
func (VerticalPlaneRestriction) String ¶
func (vp VerticalPlaneRestriction) String() string
func (VerticalPlaneRestriction) ToCircles ¶
func (vp VerticalPlaneRestriction) ToCircles() []LatlongCircle
func (VerticalPlaneRestriction) ToLines ¶
func (vp VerticalPlaneRestriction) ToLines() []LatlongLine
type Window ¶
type Window struct {
LatlongLine // embedded
MinAltitude float64
MaxAltitude float64
}
Window is a finite line across the land, with altitude restrictions It implements GeoRestricter and MapRenderer.
func (Window) IntersectsAltitude ¶
func (Window) IntersectsLine ¶
func (w Window) IntersectsLine(l LatlongLine) bool
func (Window) IntersectsLineDeb ¶
func (w Window) IntersectsLineDeb(l LatlongLine) (bool, string)
func (Window) ToCircles ¶
func (w Window) ToCircles() []LatlongCircle
Implement MapRenderer interface
func (Window) ToLines ¶
func (w Window) ToLines() []LatlongLine