Class: AIXM::Feature::Airport
- Inherits:
-
AIXM::Feature
- Object
- Component
- AIXM::Feature
- AIXM::Feature::Airport
- Defined in:
- lib/aixm/feature/airport.rb
Overview
Defined area on land or water to be used for the arrival, departure and surface movement of aircraft.
Cheat Sheet in Pseudo Code:
airport = AIXM.airport(
source: String or nil
region: String or nil
organisation: AIXM.organisation
id: String
name: String
xy: AIXM.xy
)
airport.gps = String or nil
airport.type = TYPES (other than AD, HP and AH only)
airport.z = AIXM.z or nil
airport.declination = Float or nil
airport.transition_z = AIXM.z or nil
airport. = AIXM. or nil
airport.operator = String or nil
airport.remarks = String or nil
airport.comment = Object or nil
airport.add_runway(AIXM.runway)
airport.add_fato(AIXM.fato)
airport.add_helipad(AIXM.helipad)
airport.add_usage_limitation(UsageLimitation::TYPES)
airport.add_unit(AIXM.unit)
airport.add_service(AIXM.service)
airport.add_address(AIXM.address)
For airports without an id
, you may assign the two character region (e.g. “LF”) which will be combined with an 8 character digest of name
.
Defined Under Namespace
Classes: UsageLimitation
Constant Summary collapse
- ID_RE =
/^([A-Z]{3,4}|[A-Z]{2}[A-Z\d]{4,})$/.freeze
- TYPES =
{ AD: :aerodrome, HP: :heliport, AH: :aerodrome_and_heliport, LS: :landing_site }.freeze
Constants inherited from AIXM::Feature
Instance Attribute Summary collapse
-
#declination ⇒ Float?
When looking towards the geographic (aka: true) north, a positive declination represents the magnetic north is to the right (aka: east) by this angle.
-
#gps ⇒ Object
GPS code.
-
#id ⇒ Object
ICAO, IATA or generated airport indicator.
-
#name ⇒ Object
Full name.
-
#operator ⇒ Object
Operator of the airport.
-
#transition_z ⇒ Object
Transition altitude in
:qnh
. -
#type ⇒ Object
Type of airport.
-
#xy ⇒ Object
Reference point.
-
#z ⇒ Object
Elevation in
:qnh
.
Attributes included from Concerns::Remarks
Attributes included from Concerns::Timetable
Attributes inherited from AIXM::Feature
Attributes inherited from Component
Instance Method Summary collapse
- #add_address(address) ⇒ self
- #add_designated_point(designated_point) ⇒ Object
- #add_fato(fato) ⇒ Object
- #add_helipad(helipad) ⇒ Object
- #add_runway(runway) ⇒ Object
- #add_service(service) ⇒ Object
- #add_unit(unit) ⇒ Object
- #add_usage_limitation {|AIXM::Feature::Airport::UsageLimitation| ... } ⇒ self
-
#addresses ⇒ Array<AIXM::Feature::Address>
Postal address, url, A/A or A/G frequency etc.
-
#designated_points ⇒ Array<AIXM::Feature::NavigationalAid::DesignatedPoint>
Designated points.
-
#fatos ⇒ Array<AIXM::Component::FATO>
FATOs present at this airport.
-
#helipads ⇒ Array<AIXM::Component::Helipad>
Helipads present at this airport.
-
#initialize(source: nil, region: nil, organisation:, id: nil, name:, xy:) ⇒ Airport
constructor
See the cheat sheet for examples on how to create instances of this class.
- #inspect ⇒ String
-
#organisation ⇒ AIXM::Feature::Organisation
Superior organisation.
-
#runways ⇒ Array<AIXM::Component::Runway>
Runways present at this airport.
-
#services ⇒ Array<AIXM::Component::Service>
Services.
-
#units ⇒ Array<AIXM::Feature::Unit>
Units.
-
#usage_limitations ⇒ Array<AIXM::Feature::Airport::UsageLimitation>
Usage limitations.
Methods included from Concerns::Association
Methods inherited from AIXM::Feature
Methods included from Concerns::HashEquality
Methods included from Concerns::XMLBuilder
#build_fragment, #to_uid, #to_xml
Methods included from Concerns::Memoize
Constructor Details
#initialize(source: nil, region: nil, organisation:, id: nil, name:, xy:) ⇒ Airport
See the cheat sheet for examples on how to create instances of this class.
192 193 194 195 |
# File 'lib/aixm/feature/airport.rb', line 192 def initialize(source: nil, region: nil, organisation:, id: nil, name:, xy:) super(source: source, region: region) self.organisation, self.name, self.id, self.xy = organisation, name, id, xy # name must be set before id end |
Instance Attribute Details
#declination ⇒ Float?
When looking towards the geographic (aka: true) north, a positive declination represents the magnetic north is to the right (aka: east) by this angle.
To convert a magnetic bearing to the corresponding geographic (aka: true) bearing, the declination has to be added.
172 173 174 |
# File 'lib/aixm/feature/airport.rb', line 172 def declination @declination end |
#gps ⇒ String? #gps=(value) ⇒ Object
GPS code
153 154 155 |
# File 'lib/aixm/feature/airport.rb', line 153 def gps @gps end |
#id ⇒ String #id=(value) ⇒ Object
ICAO, IATA or generated airport indicator.
-
four letter ICAO indicator (e.g. “LFMV”)
-
three letter IATA indicator (e.g. “AVN”)
-
two letter ICAO country code + four digit number (e.g. “LF1234”)
-
two letter ICAO country code + at least four letters/digits (e.g. “LFFOOBAR123” or “LF” + GPS code)
129 130 131 |
# File 'lib/aixm/feature/airport.rb', line 129 def id @id end |
#name ⇒ String #name=(value) ⇒ Object
Full name
137 138 139 |
# File 'lib/aixm/feature/airport.rb', line 137 def name @name end |
#operator ⇒ String? #operator=(value) ⇒ Object
Operator of the airport
188 189 190 |
# File 'lib/aixm/feature/airport.rb', line 188 def operator @operator end |
#transition_z ⇒ AIXM::Z? #transition_z=(value) ⇒ Object
Transition altitude in :qnh
180 181 182 |
# File 'lib/aixm/feature/airport.rb', line 180 def transition_z @transition_z end |
#type ⇒ Symbol #type=(value) ⇒ Object
Type of airport.
The type is usually derived from the presence of runways and helipads, however, this may be overridden by setting an alternative value, most notably :landing_site
.
231 232 233 234 235 236 237 238 |
# File 'lib/aixm/feature/airport.rb', line 231 def type @type = case when @type then @type when runways.any? && (helipads.any? || fatos.any?) then :aerodrome_and_heliport when runways.any? then :aerodrome when helipads.any? || fatos.any? then :heliport end end |
Instance Method Details
#add_address(address) ⇒ self
111 |
# File 'lib/aixm/feature/airport.rb', line 111 has_many :addresses, as: :addressable |
#add_designated_point(designated_point) ⇒ Object
89 |
# File 'lib/aixm/feature/airport.rb', line 89 has_many :designated_points |
#add_service(service) ⇒ Object
103 |
# File 'lib/aixm/feature/airport.rb', line 103 has_many :services |
#add_usage_limitation {|AIXM::Feature::Airport::UsageLimitation| ... } ⇒ self
82 |
# File 'lib/aixm/feature/airport.rb', line 82 has_many :usage_limitations, accept: 'AIXM::Feature::Airport::UsageLimitation' do |usage_limitation, type:| end |
#addresses ⇒ Array<AIXM::Feature::Address>
Returns postal address, url, A/A or A/G frequency etc.
111 |
# File 'lib/aixm/feature/airport.rb', line 111 has_many :addresses, as: :addressable |
#designated_points ⇒ Array<AIXM::Feature::NavigationalAid::DesignatedPoint>
Returns designated points.
89 |
# File 'lib/aixm/feature/airport.rb', line 89 has_many :designated_points |
#fatos ⇒ Array<AIXM::Component::FATO>
Returns FATOs present at this airport.
60 |
# File 'lib/aixm/feature/airport.rb', line 60 has_many :fatos |
#helipads ⇒ Array<AIXM::Component::Helipad>
Returns helipads present at this airport.
67 |
# File 'lib/aixm/feature/airport.rb', line 67 has_many :helipads |
#inspect ⇒ String
198 199 200 |
# File 'lib/aixm/feature/airport.rb', line 198 def inspect %Q(#<#{self.class} id=#{id.inspect}>) end |
#organisation ⇒ AIXM::Feature::Organisation
Returns superior organisation.
115 |
# File 'lib/aixm/feature/airport.rb', line 115 belongs_to :organisation, as: :member |
#runways ⇒ Array<AIXM::Component::Runway>
Returns runways present at this airport.
74 |
# File 'lib/aixm/feature/airport.rb', line 74 has_many :runways |
#services ⇒ Array<AIXM::Component::Service>
Returns services.
103 |
# File 'lib/aixm/feature/airport.rb', line 103 has_many :services |
#units ⇒ Array<AIXM::Feature::Unit>
Returns units.
96 |
# File 'lib/aixm/feature/airport.rb', line 96 has_many :units |
#usage_limitations ⇒ Array<AIXM::Feature::Airport::UsageLimitation>
Returns usage limitations.
82 |
# File 'lib/aixm/feature/airport.rb', line 82 has_many :usage_limitations, accept: 'AIXM::Feature::Airport::UsageLimitation' do |usage_limitation, type:| end |