class AIXM::Component::VerticalLimit

Vertical limit defines a 3D airspace vertically. It is often noted in AIP as follows:

upper_z
(max_z)   whichever is higher
-------
lower_z
(min_z)   whichever is lower

Cheat Sheet in Pseudo Code:

vertical_limit = AIXM.vertical_limit(
  upper_z: AIXM.z
  max_z: AIXM.z or nil
  lower_z: AIXM.z
  min_z: AIXM.z or nil
)

Shortcuts:

@see gitlab.com/openflightmaps/ofmx/wikis/Airspace#ase-airspace

Constants

CODES

@api private

TAGS

@api private

Attributes

lower_z[R]

@return [AIXM::Z] lower limit

max_z[R]

@return [AIXM::Z] alternative upper limit (“whichever is higher”)

min_z[R]

@return [AIXM::Z] alternative lower limit (“whichever is lower”)

upper_z[R]

@return [AIXM::Z] upper limit

Public Class Methods

new(upper_z:, max_z: nil, lower_z:, min_z: nil) click to toggle source
   # File lib/aixm/component/vertical_limit.rb
53 def initialize(upper_z:, max_z: nil, lower_z:, min_z: nil)
54   self.upper_z, self.max_z, self.lower_z, self.min_z = upper_z, max_z, lower_z, min_z
55 end

Public Instance Methods

inspect() click to toggle source

@return [String]

   # File lib/aixm/component/vertical_limit.rb
58 def inspect
59   payload = %i(upper_z max_z lower_z min_z).map { %Q(#{_1}="#{send(_1)}") if send(_1) }.compact
60   %Q(#<#{self.class} #{payload.join(' ')}>)
61 end
lower_z=(value) click to toggle source
   # File lib/aixm/component/vertical_limit.rb
73 def lower_z=(value)
74   fail(ArgumentError, "invalid lower_z") unless value.is_a? AIXM::Z
75   @lower_z = value
76 end
max_z=(value) click to toggle source
   # File lib/aixm/component/vertical_limit.rb
68 def max_z=(value)
69   fail(ArgumentError, "invalid max_z") unless value.nil? || value.is_a?(AIXM::Z)
70   @max_z = value
71 end
min_z=(value) click to toggle source
   # File lib/aixm/component/vertical_limit.rb
78 def min_z=(value)
79   fail(ArgumentError, "invalid min_z") unless value.nil? || value.is_a?(AIXM::Z)
80   @min_z = value
81 end
to_xml() click to toggle source

@return [String] AIXM or OFMX markup

   # File lib/aixm/component/vertical_limit.rb
84 def to_xml
85   TAGS.keys.each_with_object(Builder::XmlMarkup.new(indent: 2)) do |limit, builder|
86     if z = send(limit)
87       builder.tag!(:"codeDistVer#{TAGS[limit]}", CODES[z.code].to_s)
88       builder.tag!(:"valDistVer#{TAGS[limit]}", z.alt.to_s)
89       builder.tag!(:"uomDistVer#{TAGS[limit]}", z.unit.upcase.to_s)
90     end
91   end.target!
92 end
upper_z=(value) click to toggle source
   # File lib/aixm/component/vertical_limit.rb
63 def upper_z=(value)
64   fail(ArgumentError, "invalid upper_z") unless value.is_a? AIXM::Z
65   @upper_z = value
66 end