Documentation ¶
Overview ¶
Package common provides common functionality and interfaces.
It includes methods to manage airfield, airspace and waypoint data, as well as other utility libraries.
Index ¶
Constants ¶
const ( UnclearAirstrip = 1 << iota Outlanding = 1 << iota ULMSite = 1 << iota GliderSite = 1 << iota ElevationProved = 1 << iota Asphalt = 1 << iota Concrete = 1 << iota Loam = 1 << iota Sand = 1 << iota Clay = 1 << iota Grass = 1 << iota Gravel = 1 << iota Dirt = 1 << iota )
Enum for Airfield flags
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Airfield ¶
type Airfield struct { ID string ShortName string Name string Region string ICAO string Flags int Catalog int Length int Elevation int Runway string Frequency float64 Latitude string Longitude string }
Airfield keeps details about a specific airfield
type Airfielder ¶
type Airfielder interface { GetAirfield(regions []string, updatedSince time.Time) ([]Airfield, error) PutAirfield(airfields []Airfield) error }
Airfielder is implemented by any data source which can provide or receive airfield information.
type Airspace ¶
type Airspace struct { ID string Date time.Time Class byte Name string Ceiling string Floor string Label []string Segments []AirspaceSegment Pen Pen }
Airspace keeps details about a specific airspace area
Date is of airspace definition or update.
Label is a list of Lat/Lon coordinates where the airspace label (usually the name) should be placed.
type AirspaceSegment ¶
type AirspaceSegment struct { Type AirspaceSegmentType Clockwise bool X string W int Radius float64 AngleStart float64 AngleEnd float64 Coordinate1 string Coordinate2 string }
AirspaceSegment is one of polygon, arc, circle.
Clockwise indicates direction for building arcs.
X is the center for arcs and circles, W is the width for airways (unused).
Data interpretation depends on record type:
Polygon: coordinate point (to be added) Arc: radius, start, end || coordinate1, coordinate2 (center in X) Circle: radius (from X)
type AirspaceSegmentType ¶
type AirspaceSegmentType int
AirspaceSegmentType is an int for an AirspaceSegment.
const ( Polygon AirspaceSegmentType = iota Arc Circle )
Constants for airspace record types
type Airspacer ¶
type Airspacer interface { GetAirspace(regions []string, updatedSince time.Time) ([]Airspace, error) PutAirspace(airspaces []Airspace) error }
Airspacer is implemented by any data source which can manage airspace information. Only one of Get() or Put() or both can be implemented by the source. FIXME: add boundbox filter to Get