Class: AIXM::Feature::Airspace
- Inherits:
-
AIXM::Feature
- Object
- Component
- AIXM::Feature
- AIXM::Feature::Airspace
- Includes:
- Concerns::Association
- Defined in:
- lib/aixm/feature/airspace.rb
Overview
Three-dimensional volume most notably defining flight zones.
Cheat Sheet in Pseudo Code:
airspace = AIXM.airspace(
source: String or nil
region: String or nil
id: String or nil # nil is converted to an 8 character digest
type: String or Symbol
local_type: String or nil
name: String or nil
)
airspace.alternative_name = String (OFMX only)
airspace.comment = Object or nil
airspace.add_layer(AIXM.layer)
airspace.geometry.add_segment(AIXM.point or AIXM.arc or AIXM.border or AIXM.circle)
Timetables and remarks have to be set on the layer!
The id
is mandatory, however, you may omit it when initializing a new airspace or assign nil
to an existing airspace which will generate a 8 character digest from type
, local_type
and name
.
Some regions define additional airspace types. In LF (France) for instance, the types RMZ (radio mandatory zone) and TMZ (transponder mandatory zone) exist. These have been added as proper types in OFMX as per OFMX_TYPES, however, AIXM encodes them as :regulated_airspace
with a local type of RMZ
or TMZ
respectively. In other words: For AIXM, the following two are identical:
AIXM.airspace(type: :radio_mandatory_zone)
AIXM.airspace(type: :regulated_airspace, local_type: "RMZ")
Constant Summary collapse
- COMMON_TYPES =
{ NAS: :national_airspace_system, FIR: :flight_information_region, 'FIR-P': :part_of_flight_information_region, UIR: :upper_flight_information_region, 'UIR-P': :part_of_upper_flight_information_region, CTA: :control_area, 'CTA-P': :part_of_control_area, OCA: :oceanic_control_area, 'OCA-P': :part_of_oceanic_control_area, UTA: :upper_control_area, 'UTA-P': :part_of_upper_control_area, TMA: :terminal_control_area, 'TMA-P': :part_of_terminal_control_area, CTR: :control_zone, 'CTR-P': :part_of_control_zone, CLASS: :airspace_with_class, OTA: :oceanic_transition_area, SECTOR: :control_sector, 'SECTOR-C': :temporarily_consolidated_sector, TSA: :temporary_segregated_area, TRA: :temporary_reserved_area, CBA: :cross_border_area, RCA: :reduced_coordination_airspace_procedure, RAS: :regulated_airspace, AWY: :airway, P: :prohibited_area, R: :restricted_area, 'R-AMC': :amc_manageable_restricted_area, D: :danger_area, 'D-AMC': :amc_manageable_danger_area, 'D-OTHER': :dangerous_activities_area, ADIZ: :air_defense_identification_zone, A: :alert_area, W: :warning_area, PROTECT: :protected_from_specific_air_traffic, AMA: :minimum_altitude_area, ASR: :altimeter_setting_region, 'NO-FIR': :airspace_outside_any_flight_information_region, POLITICAL: :political_area, PART: :part_of_airspace }.freeze
- OFMX_TYPES =
{ DRA: :drone_area, RMZ: :radio_mandatory_zone, TMZ: :transponder_mandatory_zone }.freeze
- TYPES =
COMMON_TYPES.merge OFMX_TYPES
Constants inherited from AIXM::Feature
Instance Attribute Summary collapse
-
#alternative_name ⇒ Object
Alternative name (e.g. “LF P 81”).
-
#id ⇒ Object
Published identifier (e.g. “LFP81”).
-
#local_type ⇒ Object
Local type.
-
#name ⇒ Object
Full name (e.g. “LF P 81 CHERBOURG”).
-
#type ⇒ Object
Type of airspace (see COMMON_TYPES and OFMX_TYPES).
Attributes inherited from AIXM::Feature
Attributes inherited from Component
Instance Method Summary collapse
- #add_layer(layer) ⇒ Object
-
#geometry ⇒ AIXM::Component::Geometry
Horizontal geometry shape.
- #geometry=(geometry) ⇒ Object
-
#initialize(source: nil, region: nil, id: nil, type:, local_type: nil, name: nil) ⇒ Airspace
constructor
See the cheat sheet for examples on how to create instances of this class.
- #inspect ⇒ String
-
#layers ⇒ Array<AIXM::Compoment::Layer>
Vertical layers.
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, id: nil, type:, local_type: nil, name: nil) ⇒ Airspace
See the cheat sheet for examples on how to create instances of this class.
157 158 159 160 161 162 |
# File 'lib/aixm/feature/airspace.rb', line 157 def initialize(source: nil, region: nil, id: nil, type:, local_type: nil, name: nil) super(source: source, region: region) self.type, self.local_type, self.name = type, local_type, name self.id = id self.geometry = AIXM.geometry end |
Instance Attribute Details
#alternative_name ⇒ String? #alternative_name=(value) ⇒ Object
Alternative name (e.g. “LF P 81”)
153 154 155 |
# File 'lib/aixm/feature/airspace.rb', line 153 def alternative_name @alternative_name end |
#id ⇒ String #id=(value) ⇒ Object
When assigning nil
, a 4 byte hex derived from #type, #name and #local_type is written instead.
Published identifier (e.g. “LFP81”).
118 119 120 |
# File 'lib/aixm/feature/airspace.rb', line 118 def id @id end |
#local_type ⇒ String? #local_type=(value) ⇒ Object
Local type.
Some regions define additional local types. They are usually further specifying type :regulated_airspace
.
137 138 139 |
# File 'lib/aixm/feature/airspace.rb', line 137 def local_type @local_type end |
#name ⇒ String? #name=(value) ⇒ Object
Full name (e.g. “LF P 81 CHERBOURG”)
145 146 147 |
# File 'lib/aixm/feature/airspace.rb', line 145 def name @name end |
#type ⇒ Symbol #type=(value) ⇒ Object
Type of airspace (see COMMON_TYPES and OFMX_TYPES)
126 127 128 |
# File 'lib/aixm/feature/airspace.rb', line 126 def type @type end |
Instance Method Details
#geometry ⇒ AIXM::Component::Geometry
Returns horizontal geometry shape.
100 |
# File 'lib/aixm/feature/airspace.rb', line 100 has_one :geometry |
#inspect ⇒ String
165 166 167 |
# File 'lib/aixm/feature/airspace.rb', line 165 def inspect %Q(#<#{self.class} type=#{type.inspect} name=#{name.inspect}>) end |
#layers ⇒ Array<AIXM::Compoment::Layer>
Returns vertical layers.
107 |
# File 'lib/aixm/feature/airspace.rb', line 107 has_many :layers |