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 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

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.



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_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)


142
143
144
# File 'lib/aixm/feature/airspace.rb', line 142

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)


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

def id
  @id
end

#local_typeString? #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.

Overloads:

  • #local_typeString?

    Returns:

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

    Parameters:

    • value (String, nil)


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

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)


134
135
136
# File 'lib/aixm/feature/airspace.rb', line 134

def name
  @name
end

#typeSymbol #type=(value) ⇒ Object

Type of airspace (see TYPES)

Overloads:

  • #typeSymbol

    Returns any of TYPES.

    Returns:

    • (Symbol)

      any of TYPES

  • #type=(value) ⇒ Object

    Parameters:

    • value (Symbol)

      any of TYPES



115
116
117
# File 'lib/aixm/feature/airspace.rb', line 115

def type
  @type
end

Instance Method Details

#add_layer(layer) ⇒ Object

Parameters:

  • layer (AIXM::Compoment::Layer)


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

has_many :layers

#geometryAIXM::Component::Geometry

Returns horizontal geometry shape.

Returns:



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

has_one :geometry

#geometry=(geometry) ⇒ Object

Parameters:



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

has_one :geometry

#inspectString

Returns:

  • (String)


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

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



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

has_many :layers