Class: AIXM::Feature::Obstacle
- Inherits:
-
AIXM::Feature
- Object
- Component
- AIXM::Feature
- AIXM::Feature::Obstacle
- Includes:
- Concerns::Association, Concerns::Remarks
- Defined in:
- lib/aixm/feature/obstacle.rb
Overview
Obstacles are individual objects described as cylindrical volume with circular base and height.
Cheat Sheet in Pseudo Code:
obstacle = AIXM.obstacle(
source: String or nil
region: String or nil
name: String or nil
type: TYPES
xy: AIXM.xy
z: AIXM.z
radius: AIXM.d or nil
)
obstacle.lighting = true or false (default for AIXM) or nil (means: unknown, default for OFMX)
obstacle.lighting_remarks = String or nil
obstacle.marking = true or false or nil (means: unknown, default)
obstacle.marking_remarks = String or nil
obstacle.height = AIXM.d or nil
obstacle.height_accurate = true or false or nil (means: unknown, default)
obstacle.xy_accuracy = AIXM.d or nil
obstacle.z_accuracy = AIXM.d or nil
obstacle.valid_from = Time or Date or String or nil
obstacle.valid_until = Time or Date or String or nil
obstacle.remarks = String or nil
obstacle.comment = Object or nil
obstacle.link_to # => AIXM.obstacle or nil
obstacle.link_type # => LINK_TYPE or nil
See ObstacleGroup for how to define physical links between two obstacles (e.g. cables between powerline towers).
Please note: As soon as an obstacle is added to an obstacle group, the xy_accuracy
and z_accuracy
of the obstacle group overwrite whatever is set on the individual obstacles. On the other hand, if the obstacle group has no source
set, it will inherit this value from the first obstacle in the group.
Constant Summary collapse
- TYPES =
{ ANTENNA: :antenna, BUILDING: :building, CHIMNEY: :chimney, CRANE: :crane, MAST: :mast, TOWER: :tower, WINDTURBINE: :wind_turbine, OTHER: :other # specify in remarks }.freeze
- LINK_TYPES =
{ CABLE: :cable, SOLID: :solid, OTHER: :other }.freeze
Constants inherited from AIXM::Feature
Instance Attribute Summary collapse
-
#height ⇒ Object
Height from ground to top point.
-
#height_accurate ⇒ Object
Height accuracy.
-
#lighting ⇒ Object
Presence of lighting (e.g. strobes).
-
#lighting_remarks ⇒ Object
Detailed description of the lighting.
-
#link_type ⇒ Symbol?
readonly
Type of physical link between this and another obstacle.
-
#linked_to ⇒ AIXM::Feature::Obstacle?
readonly
Another obstacle to which a physical link exists.
-
#marking ⇒ Object
Presence of marking (e.g. red/white paint).
-
#marking_remarks ⇒ Object
Detailed description of the marking.
-
#name ⇒ Object
Full name.
-
#radius ⇒ Object
Circular base radius.
-
#type ⇒ Object
Type of obstacle.
-
#valid_from ⇒ Object
Effective after this point in time.
-
#valid_until ⇒ Object
Effective until this point in time.
-
#xy ⇒ Object
Circular base center point.
-
#xy_accuracy ⇒ Object
Margin of error for circular base center point.
-
#z ⇒ Object
Elevation of the top point in
:qnh
. -
#z_accuracy ⇒ Object
Margin of error for top point.
Attributes included from Concerns::Remarks
Attributes inherited from AIXM::Feature
Attributes inherited from Component
Instance Method Summary collapse
-
#grouped? ⇒ Boolean
Whether part of an obstacle group.
-
#initialize(source: nil, region: nil, name: nil, type:, xy:, z:, radius: nil) ⇒ Obstacle
constructor
See the cheat sheet for examples on how to create instances of this class.
- #inspect ⇒ String
-
#linked? ⇒ Boolean
Whether obstacle is linked to another one.
-
#obstacle_group ⇒ AIXM::Feature::ObstacleGroup
Group this obstacle belongs to.
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, name: nil, type:, xy:, z:, radius: nil) ⇒ Obstacle
See the cheat sheet for examples on how to create instances of this class.
203 204 205 206 207 |
# File 'lib/aixm/feature/obstacle.rb', line 203 def initialize(source: nil, region: nil, name: nil, type:, xy:, z:, radius: nil) super(source: source, region: region) self.name, self.type, self.xy, self.z, self.radius = name, type, xy, z, radius @lighting = @marking = false end |
Instance Attribute Details
#height ⇒ AIXM::D? #height=(value) ⇒ Object
Height from ground to top point.
149 150 151 |
# File 'lib/aixm/feature/obstacle.rb', line 149 def height @height end |
#height_accurate ⇒ Boolean? #height_accurate=(value) ⇒ Object
Height accuracy.
157 158 159 |
# File 'lib/aixm/feature/obstacle.rb', line 157 def height_accurate @height_accurate end |
#lighting ⇒ Boolean? #lighting=(value) ⇒ Object
Presence of lighting (e.g. strobes).
117 118 119 |
# File 'lib/aixm/feature/obstacle.rb', line 117 def lighting @lighting end |
#lighting_remarks ⇒ String? #lighting_remarks=(value) ⇒ Object
Detailed description of the lighting.
125 126 127 |
# File 'lib/aixm/feature/obstacle.rb', line 125 def lighting_remarks @lighting_remarks end |
#link_type ⇒ Symbol?
Type of physical link between this and another obstacle.
199 200 201 |
# File 'lib/aixm/feature/obstacle.rb', line 199 def link_type @link_type end |
#linked_to ⇒ AIXM::Feature::Obstacle?
Another obstacle to which a physical link exists.
194 195 196 |
# File 'lib/aixm/feature/obstacle.rb', line 194 def linked_to @linked_to end |
#marking ⇒ Boolean? #marking=(value) ⇒ Object
Presence of marking (e.g. red/white paint).
133 134 135 |
# File 'lib/aixm/feature/obstacle.rb', line 133 def marking @marking end |
#marking_remarks ⇒ String nil #marking_remarks=(value) ⇒ Object
Detailed description of the marking.
141 142 143 |
# File 'lib/aixm/feature/obstacle.rb', line 141 def marking_remarks @marking_remarks end |
#name ⇒ String #name=(value) ⇒ Object
Full name.
77 78 79 |
# File 'lib/aixm/feature/obstacle.rb', line 77 def name @name end |
#radius ⇒ AIXM::D #radius=(value) ⇒ Object
Circular base radius.
101 102 103 |
# File 'lib/aixm/feature/obstacle.rb', line 101 def radius @radius end |
#type ⇒ Symbol #type=(value) ⇒ Object
Type of obstacle.
85 86 87 |
# File 'lib/aixm/feature/obstacle.rb', line 85 def type @type end |
#valid_from ⇒ Time, ... #valid_from=(value) ⇒ Object
Effective after this point in time.
181 182 183 |
# File 'lib/aixm/feature/obstacle.rb', line 181 def valid_from @valid_from end |
#valid_until ⇒ Time, ... #valid_until=(value) ⇒ Object
Effective until this point in time.
189 190 191 |
# File 'lib/aixm/feature/obstacle.rb', line 189 def valid_until @valid_until end |
#xy ⇒ AIXM::XY #xy=(value) ⇒ Object
Circular base center point.
93 94 95 |
# File 'lib/aixm/feature/obstacle.rb', line 93 def xy @xy end |
#xy_accuracy ⇒ AIXM::D? #xy_accuracy=(value) ⇒ Object
Margin of error for circular base center point.
165 166 167 |
# File 'lib/aixm/feature/obstacle.rb', line 165 def xy_accuracy @xy_accuracy end |
Instance Method Details
#grouped? ⇒ Boolean
Whether part of an obstacle group.
298 299 300 |
# File 'lib/aixm/feature/obstacle.rb', line 298 def grouped? obstacle_group && obstacle_group.obstacles.count > 1 end |
#inspect ⇒ String
210 211 212 |
# File 'lib/aixm/feature/obstacle.rb', line 210 def inspect %Q(#<#{self.class} xy="#{xy}" type=#{type.inspect} name=#{name.inspect}>) end |
#linked? ⇒ Boolean
Whether obstacle is linked to another one.
305 306 307 |
# File 'lib/aixm/feature/obstacle.rb', line 305 def linked? !!linked_to end |
#obstacle_group ⇒ AIXM::Feature::ObstacleGroup
Returns group this obstacle belongs to.
69 |
# File 'lib/aixm/feature/obstacle.rb', line 69 belongs_to :obstacle_group |