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 intance, the types RMZ (radio mandatory zone) and TMZ (transponder mandatory zone) exist. Such airspaces are usually specified together with a generic type such as :regulated_airspace
:
airspace= AIXM.airspace(type: :regulated_airspace, local_type: "RMZ")
Constant Summary collapse
- 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
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 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.
146 147 148 149 150 151 |
# File 'lib/aixm/feature/airspace.rb', line 146 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”)
142 143 144 |
# File 'lib/aixm/feature/airspace.rb', line 142 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”).
107 108 109 |
# File 'lib/aixm/feature/airspace.rb', line 107 def id @id end |
#local_type ⇒ String? #local_type=(value) ⇒ Object
Local type.
Some regions define additional local types such as “RMZ” or “TMZ”. They are often further specifying type :regulated_airspace
.
126 127 128 |
# File 'lib/aixm/feature/airspace.rb', line 126 def local_type @local_type end |
#name ⇒ String? #name=(value) ⇒ Object
Full name (e.g. “LF P 81 CHERBOURG”)
134 135 136 |
# File 'lib/aixm/feature/airspace.rb', line 134 def name @name end |
Instance Method Details
#geometry ⇒ AIXM::Component::Geometry
Returns horizontal geometry shape.
89 |
# File 'lib/aixm/feature/airspace.rb', line 89 has_one :geometry |
#inspect ⇒ String
154 155 156 |
# File 'lib/aixm/feature/airspace.rb', line 154 def inspect %Q(#<#{self.class} type=#{type.inspect} name=#{name.inspect}>) end |
#layers ⇒ Array<AIXM::Compoment::Layer>
Returns vertical layers.
96 |
# File 'lib/aixm/feature/airspace.rb', line 96 has_many :layers |