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.comment = Object or nil
airspace.add_layer(AIXM.layer)
airspace.geometry.add_segment(AIXM.point or AIXM.arc or AIXM.border or AIXM.circle)

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.


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

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

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

104
105
106
# File 'lib/aixm/feature/airspace.rb', line 104

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)

123
124
125
# File 'lib/aixm/feature/airspace.rb', line 123

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)

131
132
133
# File 'lib/aixm/feature/airspace.rb', line 131

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


112
113
114
# File 'lib/aixm/feature/airspace.rb', line 112

def type
  @type
end

Instance Method Details

#add_layer(layer) ⇒ Object

Parameters:

  • layer (AIXM::Compoment::Layer)

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

has_many :layers

#geometryAIXM::Component::Geometry

Returns horizontal geometry shape.

Returns:


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

has_one :geometry

#geometry=(geometry) ⇒ Object

Parameters:


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

has_one :geometry

#inspectString

Returns:

  • (String)

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

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


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

has_many :layers