Class: AIXM::Feature::NavigationalAid::DesignatedPoint
- Inherits:
-
AIXM::Feature::NavigationalAid
- Object
- AIXM::Feature
- AIXM::Feature::NavigationalAid
- AIXM::Feature::NavigationalAid::DesignatedPoint
- Defined in:
- lib/aixm/feature/navigational_aid/designated_point.rb
Overview
Named geographical location used in defining an ATS route, aircraft flight paths or for other navigation purposes.
Cheat Sheet in Pseudo Code:
designated_point = AIXM.designated_point(
source: String or nil
id: String
name: String or nil
xy: AIXM.xy
type: TYPES
)
designated_point.airport = AIXM.airport or nil
designated_point.remarks = String or nil
Constant Summary collapse
- TYPES =
{ ICAO: :icao, # five-letter ICAO id ADHP: :adhp, # airport related id COORD: :coordinates, # derived from geographical coordinates 'VFR-RP': :vfr_reporting_point, # usually one or two letter id 'VFR-MRP': :vfr_mandatory_reporting_point, # usually one or two letter id 'VFR-ENR': :vfr_en_route_point, 'VFR-GLD': :vfr_glider_point, OTHER: :other # specify in remarks }.freeze
Instance Attribute Summary collapse
-
#airport ⇒ AIXM::Feature::Airport
Airport this designated point is associated with.
-
#type ⇒ Symbol
Type of designated point.
Attributes inherited from AIXM::Feature::NavigationalAid
#id, #name, #remarks, #timetable, #xy, #z
Attributes inherited from AIXM::Feature
Instance Method Summary collapse
-
#initialize(type:, **arguments) ⇒ DesignatedPoint
constructor
A new instance of DesignatedPoint.
-
#to_uid ⇒ String
UID markup.
-
#to_xml ⇒ String
AIXM or OFMX markup.
Methods inherited from AIXM::Feature::NavigationalAid
Methods inherited from AIXM::Feature
Constructor Details
#initialize(type:, **arguments) ⇒ DesignatedPoint
Returns a new instance of DesignatedPoint.
45 46 47 48 |
# File 'lib/aixm/feature/navigational_aid/designated_point.rb', line 45 def initialize(type:, **arguments) super(organisation: false, z: nil, **arguments) self.type = type end |
Instance Attribute Details
#airport ⇒ AIXM::Feature::Airport
Returns airport this designated point is associated with.
43 44 45 |
# File 'lib/aixm/feature/navigational_aid/designated_point.rb', line 43 def airport @airport end |
#type ⇒ Symbol
Returns type of designated point.
39 40 41 |
# File 'lib/aixm/feature/navigational_aid/designated_point.rb', line 39 def type @type end |
Instance Method Details
#to_uid ⇒ String
Returns UID markup.
60 61 62 63 64 65 66 67 |
# File 'lib/aixm/feature/navigational_aid/designated_point.rb', line 60 def to_uid builder = Builder::XmlMarkup.new(indent: 2) builder.DpnUid do |dpn_uid| dpn_uid.codeId(id) dpn_uid.geoLat(xy.lat(AIXM.schema)) dpn_uid.geoLong(xy.long(AIXM.schema)) end end |
#to_xml ⇒ String
Returns AIXM or OFMX markup.
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/aixm/feature/navigational_aid/designated_point.rb', line 70 def to_xml builder = to_builder builder.Dpn({ source: (source if AIXM.ofmx?) }.compact) do |dpn| dpn << to_uid.indent(2) dpn << airport.to_uid(as: :AhpUidAssoc).indent(2) if airport dpn.codeDatum('WGE') dpn.codeType(AIXM.aixm? && type_key =~ /^VFR/ ? 'OTHER' : type_key.to_s) dpn.txtName(name) if name dpn.txtRmk(remarks) if remarks dpn.target! end end |