Class: AIXM::Feature::Airspace

Inherits:
AIXM::Feature show all
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

REGION_RE

Instance Attribute Summary collapse

Attributes inherited from AIXM::Feature

#comment, #region, #source

Attributes inherited from Component

#meta

Instance Method Summary collapse

Methods included from Concerns::Association

included

Methods inherited from AIXM::Feature

#==, #hash

Methods included from Concerns::HashEquality

#eql?, #hash

Methods included from Concerns::XMLBuilder

#build_fragment, #to_uid, #to_xml

Methods included from Concerns::Memoize

included, method

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_nameString? #alternative_name=(value) ⇒ Object

Alternative name (e.g. “LF P 81”)

Overloads:

  • #alternative_nameString?

    Returns:

    • (String, nil)
  • #alternative_name=(value) ⇒ Object

    Parameters:

    • value (String, nil)


153
154
155
# File 'lib/aixm/feature/airspace.rb', line 153

def alternative_name
  @alternative_name
end

#idString #id=(value) ⇒ Object

Note:

When assigning nil, a 4 byte hex derived from #type, #name and #local_type is written instead.

Published identifier (e.g. “LFP81”).

Overloads:

  • #idString

    Returns:

    • (String)
  • #id=(value) ⇒ Object

    Parameters:

    • value (String)


118
119
120
# File 'lib/aixm/feature/airspace.rb', line 118

def id
  @id
end

#local_typeString? #local_type=(value) ⇒ Object

Local type.

Some regions define additional local types. They are usually further specifying type :regulated_airspace.

Overloads:

  • #local_typeString?

    Returns:

    • (String, nil)
  • #local_type=(value) ⇒ Object

    Parameters:

    • value (String, nil)


137
138
139
# File 'lib/aixm/feature/airspace.rb', line 137

def local_type
  @local_type
end

#nameString? #name=(value) ⇒ Object

Full name (e.g. “LF P 81 CHERBOURG”)

Overloads:

  • #nameString?

    Returns:

    • (String, nil)
  • #name=(value) ⇒ Object

    Parameters:

    • value (String, nil)


145
146
147
# File 'lib/aixm/feature/airspace.rb', line 145

def name
  @name
end

#typeSymbol #type=(value) ⇒ Object

Type of airspace (see COMMON_TYPES and OFMX_TYPES)

Overloads:



126
127
128
# File 'lib/aixm/feature/airspace.rb', line 126

def type
  @type
end

Instance Method Details

#add_layer(layer) ⇒ Object

Parameters:

  • layer (AIXM::Compoment::Layer)


107
# File 'lib/aixm/feature/airspace.rb', line 107

has_many :layers

#geometryAIXM::Component::Geometry

Returns horizontal geometry shape.

Returns:



100
# File 'lib/aixm/feature/airspace.rb', line 100

has_one :geometry

#geometry=(geometry) ⇒ Object

Parameters:



100
# File 'lib/aixm/feature/airspace.rb', line 100

has_one :geometry

#inspectString

Returns:

  • (String)


165
166
167
# File 'lib/aixm/feature/airspace.rb', line 165

def inspect
  %Q(#<#{self.class} type=#{type.inspect} name=#{name.inspect}>)
end

#layersArray<AIXM::Compoment::Layer>

Returns vertical layers.

Returns:

  • (Array<AIXM::Compoment::Layer>)

    vertical layers



107
# File 'lib/aixm/feature/airspace.rb', line 107

has_many :layers