Class: AIXM::Feature::NavigationalAid::Marker

Inherits:
AIXM::Feature::NavigationalAid show all
Defined in:
lib/aixm/feature/navigational_aid/marker.rb

Overview

Note:

Marker are not fully implemented because they usually have to be associated with an ILS which are not implemented as of now.

Marker beacons guide an aircraft on a specific route e.g. towards a runway (which is why marker beacons are often part of an ILS). Their VHF radio beacons are transmitted on 75 MHz.

Cheat Sheet in Pseudo Code:

marker = AIXM.marker(
  source: String or nil
  organisation: AIXM.organisation
  id: String
  name: String
  xy: AIXM.xy
  z: AIXM.z or nil
  type: :outer or :middle or :inner or :backcourse
)
marker.timetable = AIXM.timetable or nil
marker.remarks = String or nil

Constant Summary collapse

TYPES =
{
  O: :outer,
  M: :middle,
  I: :inner,
  C: :backcourse,
  OTHER: :other     # specify in remarks
}

Instance Attribute Summary collapse

Attributes inherited from AIXM::Feature::NavigationalAid

#id, #name, #remarks, #timetable, #xy, #z

Attributes inherited from AIXM::Feature

#source

Instance Method Summary collapse

Methods inherited from AIXM::Feature::NavigationalAid

#inspect, #kind

Methods inherited from AIXM::Feature

#==

Constructor Details

#initialize(type:, **arguments) ⇒ Marker

TODO: Marker require an associated ILS (not yet implemented)


43
44
45
46
47
# File 'lib/aixm/feature/navigational_aid/marker.rb', line 43

def initialize(type:, **arguments)
  super(**arguments)
  self.type = type
  warn("WARNING: Maker is not fully implemented yet due to the lack of ILS")
end

Instance Attribute Details

#typeSymbol


40
41
42
# File 'lib/aixm/feature/navigational_aid/marker.rb', line 40

def type
  @type
end

Instance Method Details

#to_uidString


54
55
56
57
58
59
60
61
# File 'lib/aixm/feature/navigational_aid/marker.rb', line 54

def to_uid
  builder = Builder::XmlMarkup.new(indent: 2)
  builder.MkrUid do |mkr_uid|
    mkr_uid.codeId(id)
    mkr_uid.geoLat(xy.lat(AIXM.schema))
    mkr_uid.geoLong(xy.long(AIXM.schema))
  end.insert_payload_hash(region: AIXM.config.mid_region)
end

#to_xmlString


64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/aixm/feature/navigational_aid/marker.rb', line 64

def to_xml
  builder = to_builder
  builder.Mkr({ source: (source if AIXM.ofmx?) }.compact) do |mkr|
    mkr << to_uid.indent(2)
    mkr << organisation.to_uid.indent(2)
    mkr.codePsnIls(type_key.to_s) if type_key
    mkr.valFreq(75)
    mkr.uomFreq('MHZ')
    mkr.txtName(name) if name
    mkr.codeDatum('WGE')
    if z
      mkr.valElev(z.alt)
      mkr.uomDistVer(z.unit.upcase.to_s)
    end
    mkr << timetable.to_xml(as: :Mtt).indent(2) if timetable
    mkr.txtRmk(remarks) if remarks
    mkr.target!
  end
end