Class: AIXM::Component::Runway

Inherits:
AIXM::Component show all
Includes:
AIXM::Concerns::Association, AIXM::Concerns::Marking, AIXM::Concerns::Remarks
Defined in:
lib/aixm/component/runway.rb

Overview

Runways are landing and takeoff strips for forward propelled aircraft.

By convention, the runway name is usually the composition of the runway forth name (smaller number) and the runway back name (bigger number) joined with a forward slash e.g. “12/30” or “16R/34L”.

A runway has one or to directions accessible as runway.forth (mandatory) and runway.back (optional). Both have identical properties.

Cheat Sheet in Pseudo Code:

runway = AIXM.runway(
  name: String
)
runway.dimensions = AIXM.r or nil
runway.surface = AIXM.surface
runway.marking = String or nil
runway.status = STATUSES or nil
runway.remarks = String or nil
runway.forth.name = AIXM.a   # preset based on the runway name
runway.forth.geographic_bearing = AIXM.a or nil
runway.forth.xy = AIXM.xy   # center point at beginning edge of runway
runway.forth.z = AIXM.z or nil   # center point at beginning edge of runway
runway.forth.touch_down_zone_z = AIXM.z or nil
runway.forth.displaced_threshold = AIXM.d or nil       # sets displaced_threshold_xy as well
runway.forth.displaced_threshold_xy = AIXM.xy or nil   # sets displaced_threshold as well
runway.forth.vasis = AIXM.vasis or nil (default: unspecified VASIS)
runway.forth.add_lighting = AIXM.lighting
runway.forth.add_approach_lighting = AIXM.approach_lighting
runway.forth.vfr_pattern = VFR_PATTERNS or nil
runway.forth.remarks = String or nil

Examples:

Bidirectional runway

runway = AIXM.runway(name: '16L/34R')
runway.name   # => '16L/34R'
runway.forth.name.to_s = '16L'
runway.forth.geographic_bearing = 165
runway.back.name.to_s = '34R'
runway.back.geographic_bearing = 345

Unidirectional runway:

runway = AIXM.runway(name: '16L')
runway.name   # => '16L'
runway.forth.name.to_s = '16L'
runway.forth.geographic_bearing = 165
runway.back = nil

See Also:

Defined Under Namespace

Classes: Direction

Constant Summary collapse

STATUSES =
{
  CLSD: :closed,
  WIP: :work_in_progress,          # e.g. construction work
  PARKED: :parked_aircraft,        # parked or disabled aircraft on helipad
  FAILAID: :visual_aids_failure,   # failure or irregular operation of visual aids
  SPOWER: :secondary_power,        # secondary power supply in operation
  OTHER: :other                    # specify in remarks
}.freeze

Instance Attribute Summary collapse

Attributes included from AIXM::Concerns::Remarks

#remarks

Attributes included from AIXM::Concerns::Marking

#marking

Attributes inherited from AIXM::Component

#meta

Instance Method Summary collapse

Methods included from AIXM::Concerns::Association

included

Methods included from AIXM::Concerns::HashEquality

#eql?, #hash

Methods included from AIXM::Concerns::XMLBuilder

#build_fragment, #to_uid, #to_xml

Methods included from AIXM::Concerns::Memoize

included, method

Constructor Details

#initialize(name:) ⇒ Runway

See the cheat sheet for examples on how to create instances of this class.



119
120
121
122
123
124
125
126
127
# File 'lib/aixm/component/runway.rb', line 119

def initialize(name:)
  self.name = name
  @name.split("/").tap do |forth_name, back_name|
    self.forth = Direction.new(name: AIXM.a(forth_name))
    self.back = Direction.new(name: AIXM.a(back_name)) if back_name
    fail(ArgumentError, "invalid name") unless !back || back.name.inverse_of?(@forth.name)
  end
  self.surface = AIXM.surface
end

Instance Attribute Details

#dimensionsAIXM::R? #dimensions=(value) ⇒ Object

Dimensions



106
107
108
# File 'lib/aixm/component/runway.rb', line 106

def dimensions
  @dimensions
end

#nameString #name=(value) ⇒ Object

Full name of runway (e.g. “12/30” or “16L/34R”)



98
99
100
# File 'lib/aixm/component/runway.rb', line 98

def name
  @name
end

#statusSymbol? #status=(value) ⇒ Object

Status of the runway



115
116
117
# File 'lib/aixm/component/runway.rb', line 115

def status
  @status
end

Instance Method Details

#airportAIXM::Feature::Airport



90
# File 'lib/aixm/component/runway.rb', line 90

belongs_to :airport

#backAIXM::Component::Runway::Direction?



79
# File 'lib/aixm/component/runway.rb', line 79

has_one :back, accept: 'AIXM::Component::Runway::Direction', allow_nil: true

#back=(back) ⇒ Object



79
# File 'lib/aixm/component/runway.rb', line 79

has_one :back, accept: 'AIXM::Component::Runway::Direction', allow_nil: true

#center_lineAIXM::L?

Center line of the runway

The center line of unidirectional runwawys is calculated using the runway dimensions. If they are unknown, the calculation is not possible and this method returns nil.



155
156
157
158
159
160
161
162
163
164
165
# File 'lib/aixm/component/runway.rb', line 155

def center_line
  if back || dimensions
    AIXM.l.add_line_point(
      xy: forth.xy,
      z: forth.z
    ).add_line_point(
      xy: (back&.xy || forth.xy.add_distance(dimensions.length, forth.geographic_bearing)),
      z: back&.z
    )
  end
end

#forthAIXM::Component::Runway::Direction



72
# File 'lib/aixm/component/runway.rb', line 72

has_one :forth, accept: 'AIXM::Component::Runway::Direction'

#forth=(forth) ⇒ Object



72
# File 'lib/aixm/component/runway.rb', line 72

has_one :forth, accept: 'AIXM::Component::Runway::Direction'

#inspectString



130
131
132
# File 'lib/aixm/component/runway.rb', line 130

def inspect
  %Q(#<#{self.class} airport=#{airport&.id.inspect} name=#{name.inspect}>)
end

#surfaceAIXM::Component::Surface



86
# File 'lib/aixm/component/runway.rb', line 86

has_one :surface, accept: 'AIXM::Component::Surface'

#surface=(surface) ⇒ Object



86
# File 'lib/aixm/component/runway.rb', line 86

has_one :surface, accept: 'AIXM::Component::Surface'