class AIXM::Feature::Airport::UsageLimitation

Limitations concerning the availability of an airport for certain flight types, aircraft types etc during specific hours.

See {AIXM::Feature::Airport::UsageLimitation::TYPES UsageLimitation::TYPES} for recognized limitations and {AIXM::Feature::Airport::UsageLimitation#add_condition UsageLimitation#add_condition} for recognized conditions.

Multiple conditions are joined with an implicit or whereas the specifics of a condition (aircraft, rule etc) are joined with an implicit and.

@example Limitation applying to any traffic

airport.add_usage_limitation(type: :permitted)

@example Limitation applying to specific traffic

airport.add_usage_limitation(type: :reservation_required) do |reservation_required|
  reservation_required.add_condition do |condition|
    condition.aircraft = :glider
  end
  reservation_required.add_condition do |condition|
    condition.rule = :ifr
    condition.origin = :international
  end
  reservation_required.timetable = AIXM::H24
  reservation_required.remarks = "Reservation 24 HRS prior to arrival"
end

@see AIXM::Feature::Airport#add_usage_limitation @see gitlab.com/openflightmaps/ofmx/wikis/Airport#ahu-airport-usage

Constants

TYPES

Attributes

remarks[R]

@return [String, nil] free text remarks

timetable[R]

@return [AIXM::Component::Timetable, nil] limitation application hours

type[R]

@return [Symbol] type of limitation

Public Class Methods

new(type:) click to toggle source
    # File lib/aixm/feature/airport.rb
358 def initialize(type:)
359   self.type = type
360 end

Public Instance Methods

inspect() click to toggle source

@return [String]

    # File lib/aixm/feature/airport.rb
363 def inspect
364   %Q(#<#{self.class} type=#{type.inspect}>)
365 end
remarks=(value) click to toggle source
    # File lib/aixm/feature/airport.rb
376 def remarks=(value)
377   @remarks = value&.to_s
378 end
timetable=(value) click to toggle source
    # File lib/aixm/feature/airport.rb
371 def timetable=(value)
372   fail(ArgumentError, "invalid timetable") unless value.nil? || value.is_a?(AIXM::Component::Timetable)
373   @timetable = value
374 end
to_xml() click to toggle source

@return [String] AIXM or OFMX markup

    # File lib/aixm/feature/airport.rb
381 def to_xml
382   builder = Builder::XmlMarkup.new(indent: 2)
383   builder.UsageLimitation do |usage_limitation|
384     usage_limitation.codeUsageLimitation(TYPES.key(type).to_s)
385     conditions.each do |condition|
386       usage_limitation << condition.to_xml.indent(2)
387     end
388     usage_limitation << timetable.to_xml(as: :Timetable).indent(2) if timetable
389     usage_limitation.txtRmk(remarks) if remarks
390   end
391 end
type=(value) click to toggle source
    # File lib/aixm/feature/airport.rb
367 def type=(value)
368   @type = TYPES.lookup(value&.to_s&.to_sym, nil) || fail(ArgumentError, "invalid type")
369 end