aixm 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +91 -11
  4. data/lib/aixm.rb +10 -0
  5. data/lib/aixm/base.rb +10 -0
  6. data/lib/aixm/component/base.rb +1 -1
  7. data/lib/aixm/component/class_layer.rb +0 -3
  8. data/lib/aixm/component/geometry.rb +0 -3
  9. data/lib/aixm/component/geometry/arc.rb +4 -8
  10. data/lib/aixm/component/geometry/base.rb +8 -0
  11. data/lib/aixm/component/geometry/border.rb +3 -8
  12. data/lib/aixm/component/geometry/circle.rb +5 -9
  13. data/lib/aixm/component/geometry/point.rb +6 -13
  14. data/lib/aixm/component/schedule.rb +8 -10
  15. data/lib/aixm/component/vertical_limits.rb +1 -4
  16. data/lib/aixm/document.rb +9 -6
  17. data/lib/aixm/f.rb +41 -0
  18. data/lib/aixm/feature/airspace.rb +5 -9
  19. data/lib/aixm/feature/base.rb +6 -0
  20. data/lib/aixm/feature/navigational_aid/base.rb +46 -0
  21. data/lib/aixm/feature/navigational_aid/designated_point.rb +69 -0
  22. data/lib/aixm/feature/navigational_aid/dme.rb +54 -0
  23. data/lib/aixm/feature/navigational_aid/marker.rb +41 -0
  24. data/lib/aixm/feature/navigational_aid/ndb.rb +56 -0
  25. data/lib/aixm/feature/navigational_aid/tacan.rb +54 -0
  26. data/lib/aixm/feature/navigational_aid/vor.rb +92 -0
  27. data/lib/aixm/refinements.rb +23 -2
  28. data/lib/aixm/shortcuts.rb +12 -5
  29. data/lib/aixm/version.rb +1 -1
  30. data/lib/aixm/xy.rb +9 -6
  31. data/lib/aixm/z.rb +22 -11
  32. data/spec/factory.rb +87 -4
  33. data/spec/lib/aixm/component/class_layer_spec.rb +6 -6
  34. data/spec/lib/aixm/component/geometry/arc_spec.rb +16 -16
  35. data/spec/lib/aixm/component/geometry/border_spec.rb +4 -4
  36. data/spec/lib/aixm/component/geometry/circle_spec.rb +10 -10
  37. data/spec/lib/aixm/component/geometry/point_spec.rb +4 -4
  38. data/spec/lib/aixm/component/geometry_spec.rb +21 -21
  39. data/spec/lib/aixm/component/schedule_spec.rb +6 -6
  40. data/spec/lib/aixm/component/vertical_limits_spec.rb +18 -18
  41. data/spec/lib/aixm/document_spec.rb +220 -30
  42. data/spec/lib/aixm/f_spec.rb +58 -0
  43. data/spec/lib/aixm/feature/airspace_spec.rb +5 -5
  44. data/spec/lib/aixm/feature/navigational_aid/base_spec.rb +37 -0
  45. data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +43 -0
  46. data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +43 -0
  47. data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +44 -0
  48. data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +54 -0
  49. data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +43 -0
  50. data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +58 -0
  51. data/spec/lib/aixm/refinements_spec.rb +27 -0
  52. data/spec/lib/aixm/xy_spec.rb +29 -23
  53. data/spec/lib/aixm/z_spec.rb +33 -17
  54. metadata +29 -2
@@ -3,8 +3,8 @@ require_relative '../../../../spec_helper'
3
3
  describe AIXM::Component::Geometry::Border do
4
4
  describe :to_digest do
5
5
  it "must return digest of payload" do
6
- subject = AIXM::Component::Geometry::Border.new(
7
- xy: AIXM::XY.new(lat: 11.1, long: 22.2),
6
+ subject = AIXM.border(
7
+ xy: AIXM.xy(lat: 11.1, long: 22.2),
8
8
  name: 'foobar'
9
9
  )
10
10
  subject.to_digest.must_equal 813052011
@@ -13,8 +13,8 @@ describe AIXM::Component::Geometry::Border do
13
13
 
14
14
  describe :to_xml do
15
15
  it "must build correct XML" do
16
- subject = AIXM::Component::Geometry::Border.new(
17
- xy: AIXM::XY.new(lat: 11.1, long: 22.2),
16
+ subject = AIXM.border(
17
+ xy: AIXM.xy(lat: 11.1, long: 22.2),
18
18
  name: 'foobar'
19
19
  )
20
20
  subject.to_xml.must_equal <<~END
@@ -3,24 +3,24 @@ require_relative '../../../../spec_helper'
3
3
  describe AIXM::Component::Geometry::Circle do
4
4
  describe :initialize do
5
5
  it "won't accept invalid arguments" do
6
- -> { AIXM::Component::Geometry::Circle.new(center_xy: 0, radius: 0) }.must_raise ArgumentError
6
+ -> { AIXM.circle(center_xy: 0, radius: 0) }.must_raise ArgumentError
7
7
  end
8
8
  end
9
9
 
10
10
  describe :north_xy do
11
11
  it "must calculate approximation of northmost point on the circumference" do
12
- subject = AIXM::Component::Geometry::Circle.new(
13
- center_xy: AIXM::XY.new(lat: 12.12345678, long: -23.12345678),
12
+ subject = AIXM.circle(
13
+ center_xy: AIXM.xy(lat: 12.12345678, long: -23.12345678),
14
14
  radius: 15
15
15
  )
16
- subject.send(:north_xy).must_equal AIXM::XY.new(lat: 12.25835502, long: -23.12345678)
16
+ subject.send(:north_xy).must_equal AIXM.xy(lat: 12.25835502, long: -23.12345678)
17
17
  end
18
18
  end
19
19
 
20
20
  describe :to_digest do
21
21
  it "must return digest of payload" do
22
- subject = AIXM::Component::Geometry::Circle.new(
23
- center_xy: AIXM::XY.new(lat: 12.12345678, long: -23.12345678),
22
+ subject = AIXM.circle(
23
+ center_xy: AIXM.xy(lat: 12.12345678, long: -23.12345678),
24
24
  radius: 15
25
25
  )
26
26
  subject.to_digest.must_equal 386055945
@@ -29,8 +29,8 @@ describe AIXM::Component::Geometry::Circle do
29
29
 
30
30
  describe :to_xml do
31
31
  it "must build correct XML for circles not near the equator" do
32
- subject = AIXM::Component::Geometry::Circle.new(
33
- center_xy: AIXM::XY.new(lat: 11.1, long: 22.2),
32
+ subject = AIXM.circle(
33
+ center_xy: AIXM.xy(lat: 11.1, long: 22.2),
34
34
  radius: 25
35
35
  )
36
36
  subject.to_xml.must_equal <<~END
@@ -46,8 +46,8 @@ describe AIXM::Component::Geometry::Circle do
46
46
  end
47
47
 
48
48
  it "must build correct XML for circles near the equator" do
49
- subject = AIXM::Component::Geometry::Circle.new(
50
- center_xy: AIXM::XY.new(lat: -0.0005, long: -22.2),
49
+ subject = AIXM.circle(
50
+ center_xy: AIXM.xy(lat: -0.0005, long: -22.2),
51
51
  radius: 50
52
52
  )
53
53
  subject.to_xml.must_equal <<~END
@@ -3,20 +3,20 @@ require_relative '../../../../spec_helper'
3
3
  describe AIXM::Component::Geometry::Point do
4
4
  describe :initialize do
5
5
  it "won't accept invalid arguments" do
6
- -> { AIXM::Component::Geometry::Point.new(xy: 0) }.must_raise ArgumentError
6
+ -> { AIXM.point(xy: 0) }.must_raise ArgumentError
7
7
  end
8
8
  end
9
9
 
10
10
  describe :to_digest do
11
11
  it "must return digest of payload" do
12
- subject = AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 11.1, long: 22.2))
12
+ subject = AIXM.point(xy: AIXM.xy(lat: 11.1, long: 22.2))
13
13
  subject.to_digest.must_equal 167706171
14
14
  end
15
15
  end
16
16
 
17
17
  describe :to_xml do
18
18
  it "must build correct XML for N/E points" do
19
- subject = AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 11.1, long: 22.2))
19
+ subject = AIXM.point(xy: AIXM.xy(lat: 11.1, long: 22.2))
20
20
  subject.to_xml.must_equal <<~END
21
21
  <Avx>
22
22
  <codeType>GRC</codeType>
@@ -28,7 +28,7 @@ describe AIXM::Component::Geometry::Point do
28
28
  end
29
29
 
30
30
  it "must build correct XML for S/W points" do
31
- subject = AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: -11.1, long: -22.2))
31
+ subject = AIXM.point(xy: AIXM.xy(lat: -11.1, long: -22.2))
32
32
  subject.to_xml.must_equal <<~END
33
33
  <Avx>
34
34
  <codeType>GRC</codeType>
@@ -3,7 +3,7 @@ require_relative '../../../spec_helper'
3
3
  describe AIXM::Component::Geometry do
4
4
  context "singularity" do
5
5
  subject do
6
- AIXM::Component::Geometry.new
6
+ AIXM.geometry
7
7
  end
8
8
 
9
9
  it "must fail validation" do
@@ -15,8 +15,8 @@ describe AIXM::Component::Geometry do
15
15
 
16
16
  context "point" do
17
17
  subject do
18
- AIXM::Component::Geometry.new.tap do |geometry|
19
- geometry << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 11, long: 22))
18
+ AIXM.geometry.tap do |geometry|
19
+ geometry << AIXM.point(xy: AIXM.xy(lat: 11, long: 22))
20
20
  end
21
21
  end
22
22
 
@@ -29,9 +29,9 @@ describe AIXM::Component::Geometry do
29
29
 
30
30
  context "line" do
31
31
  subject do
32
- AIXM::Component::Geometry.new.tap do |geometry|
33
- geometry << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 11, long: 22))
34
- geometry << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 22, long: 33))
32
+ AIXM.geometry.tap do |geometry|
33
+ geometry << AIXM.point(xy: AIXM.xy(lat: 11, long: 22))
34
+ geometry << AIXM.point(xy: AIXM.xy(lat: 22, long: 33))
35
35
  end
36
36
  end
37
37
 
@@ -44,9 +44,9 @@ describe AIXM::Component::Geometry do
44
44
 
45
45
  context "polygon" do
46
46
  subject do
47
- AIXM::Component::Geometry.new.tap do |geometry|
48
- geometry << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 11, long: 22))
49
- geometry << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 22, long: 33))
47
+ AIXM.geometry.tap do |geometry|
48
+ geometry << AIXM.point(xy: AIXM.xy(lat: 11, long: 22))
49
+ geometry << AIXM.point(xy: AIXM.xy(lat: 22, long: 33))
50
50
  end
51
51
  end
52
52
 
@@ -57,7 +57,7 @@ describe AIXM::Component::Geometry do
57
57
  end
58
58
 
59
59
  it "must recognize closed" do
60
- subject << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 11, long: 22))
60
+ subject << AIXM.point(xy: AIXM.xy(lat: 11, long: 22))
61
61
  subject.wont_be :circle?
62
62
  subject.must_be :closed_shape?
63
63
  subject.must_be :complete?
@@ -91,9 +91,9 @@ describe AIXM::Component::Geometry do
91
91
 
92
92
  context "arc" do
93
93
  subject do
94
- AIXM::Component::Geometry.new.tap do |geometry|
95
- geometry << AIXM::Component::Geometry::Arc.new(xy: AIXM::XY.new(lat: 11, long: 22), center_xy: AIXM::XY.new(lat: 10, long: 20), clockwise: true)
96
- geometry << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 22, long: 33))
94
+ AIXM.geometry.tap do |geometry|
95
+ geometry << AIXM.arc(xy: AIXM.xy(lat: 11, long: 22), center_xy: AIXM.xy(lat: 10, long: 20), clockwise: true)
96
+ geometry << AIXM.point(xy: AIXM.xy(lat: 22, long: 33))
97
97
  end
98
98
  end
99
99
 
@@ -104,7 +104,7 @@ describe AIXM::Component::Geometry do
104
104
  end
105
105
 
106
106
  it "must recognize closed" do
107
- subject << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 11, long: 22))
107
+ subject << AIXM.point(xy: AIXM.xy(lat: 11, long: 22))
108
108
  subject.wont_be :circle?
109
109
  subject.must_be :closed_shape?
110
110
  subject.must_be :complete?
@@ -136,9 +136,9 @@ describe AIXM::Component::Geometry do
136
136
 
137
137
  context "border" do
138
138
  subject do
139
- AIXM::Component::Geometry.new.tap do |geometry|
140
- geometry << AIXM::Component::Geometry::Border.new(xy: AIXM::XY.new(lat: 11, long: 22), name: 'foobar')
141
- geometry << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 22, long: 33))
139
+ AIXM.geometry.tap do |geometry|
140
+ geometry << AIXM.border(xy: AIXM.xy(lat: 11, long: 22), name: 'foobar')
141
+ geometry << AIXM.point(xy: AIXM.xy(lat: 22, long: 33))
142
142
  end
143
143
  end
144
144
 
@@ -149,7 +149,7 @@ describe AIXM::Component::Geometry do
149
149
  end
150
150
 
151
151
  it "must recognize closed" do
152
- subject << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 11, long: 22))
152
+ subject << AIXM.point(xy: AIXM.xy(lat: 11, long: 22))
153
153
  subject.wont_be :circle?
154
154
  subject.must_be :closed_shape?
155
155
  subject.must_be :complete?
@@ -179,8 +179,8 @@ describe AIXM::Component::Geometry do
179
179
 
180
180
  context "circle" do
181
181
  subject do
182
- AIXM::Component::Geometry.new.tap do |geometry|
183
- geometry << AIXM::Component::Geometry::Circle.new(center_xy: AIXM::XY.new(lat: 11, long: 22), radius: 10)
182
+ AIXM.geometry.tap do |geometry|
183
+ geometry << AIXM.circle(center_xy: AIXM.xy(lat: 11, long: 22), radius: 10)
184
184
  end
185
185
  end
186
186
 
@@ -191,7 +191,7 @@ describe AIXM::Component::Geometry do
191
191
  end
192
192
 
193
193
  it "must fail validation when additional elements are present" do
194
- subject << AIXM::Component::Geometry::Point.new(xy: AIXM::XY.new(lat: 11, long: 22))
194
+ subject << AIXM.point(xy: AIXM.xy(lat: 11, long: 22))
195
195
  subject.wont_be :circle?
196
196
  subject.wont_be :closed_shape?
197
197
  subject.wont_be :complete?
@@ -3,28 +3,28 @@ require_relative '../../../spec_helper'
3
3
  describe AIXM::Component::Schedule do
4
4
  describe :initialize do
5
5
  it "won't accept invalid arguments" do
6
- -> { AIXM::Component::Schedule.new(code: 'foobar') }.must_raise ArgumentError
6
+ -> { AIXM.schedule(code: 'foobar') }.must_raise ArgumentError
7
7
  end
8
8
 
9
9
  it "must accept explicit codes" do
10
- AIXM::Component::Schedule.new(code: :sunrise_to_sunset).code.must_equal :HJ
10
+ AIXM.schedule(code: :sunrise_to_sunset).code.must_equal :sunrise_to_sunset
11
11
  end
12
12
 
13
13
  it "must accept short codes" do
14
- AIXM::Component::Schedule.new(code: :H24).code.must_equal :H24
14
+ AIXM.schedule(code: :H24).code.must_equal :continuous
15
15
  end
16
16
  end
17
17
 
18
18
  describe :to_digest do
19
19
  it "must return digest of payload" do
20
- subject = AIXM::Component::Schedule.new(code: :H24)
21
- subject.to_digest.must_equal 962036587
20
+ subject = AIXM.schedule(code: :continuous)
21
+ subject.to_digest.must_equal 349179367
22
22
  end
23
23
  end
24
24
 
25
25
  describe :to_xml do
26
26
  it "must build correct XML" do
27
- subject = AIXM::Component::Schedule.new(code: :H24)
27
+ subject = AIXM.schedule(code: :continuous)
28
28
  subject.to_xml.must_equal <<~END
29
29
  <codeWorkHr>H24</codeWorkHr>
30
30
  END
@@ -3,28 +3,28 @@ require_relative '../../../spec_helper'
3
3
  describe AIXM::Component::VerticalLimits do
4
4
  describe :initialize do
5
5
  it "won't accept invalid arguments" do
6
- z = AIXM::Z.new(alt: 1000, code: :QNH)
7
- -> { AIXM::Component::VerticalLimits.new(upper_z: 0, lower_z: z, max_z: z, min_z: z) }.must_raise ArgumentError
8
- -> { AIXM::Component::VerticalLimits.new(upper_z: z, lower_z: 0, max_z: z, min_z: z) }.must_raise ArgumentError
9
- -> { AIXM::Component::VerticalLimits.new(upper_z: z, lower_z: z, max_z: 0, min_z: z) }.must_raise ArgumentError
10
- -> { AIXM::Component::VerticalLimits.new(upper_z: z, lower_z: z, max_z: z, min_z: 0) }.must_raise ArgumentError
6
+ z = AIXM.z(1000, :qnh)
7
+ -> { AIXM.vertical_limits(upper_z: 0, lower_z: z, max_z: z, min_z: z) }.must_raise ArgumentError
8
+ -> { AIXM.vertical_limits(upper_z: z, lower_z: 0, max_z: z, min_z: z) }.must_raise ArgumentError
9
+ -> { AIXM.vertical_limits(upper_z: z, lower_z: z, max_z: 0, min_z: z) }.must_raise ArgumentError
10
+ -> { AIXM.vertical_limits(upper_z: z, lower_z: z, max_z: z, min_z: 0) }.must_raise ArgumentError
11
11
  end
12
12
  end
13
13
 
14
14
  describe :to_digest do
15
15
  it "must return digest of payload" do
16
- subject = AIXM::Component::VerticalLimits.new(
17
- upper_z: AIXM::Z.new(alt: 2000, code: :QNH),
16
+ subject = AIXM.vertical_limits(
17
+ upper_z: AIXM.z(2000, :qnh),
18
18
  lower_z: AIXM::GROUND
19
19
  )
20
- subject.to_digest.must_equal 929399130
20
+ subject.to_digest.must_equal 867600845
21
21
  end
22
22
  end
23
23
 
24
24
  describe :to_xml do
25
25
  it "must build correct XML with only upper_z and lower_z" do
26
- subject = AIXM::Component::VerticalLimits.new(
27
- upper_z: AIXM::Z.new(alt: 2000, code: :QNH),
26
+ subject = AIXM.vertical_limits(
27
+ upper_z: AIXM.z(2000, :qnh),
28
28
  lower_z: AIXM::GROUND
29
29
  )
30
30
  subject.to_xml.must_equal <<~END
@@ -38,10 +38,10 @@ describe AIXM::Component::VerticalLimits do
38
38
  end
39
39
 
40
40
  it "must build correct XML with additional max_z" do
41
- subject = AIXM::Component::VerticalLimits.new(
42
- upper_z: AIXM::Z.new(alt: 65, code: :QNE),
43
- lower_z: AIXM::Z.new(alt: 1000, code: :QFE),
44
- max_z: AIXM::Z.new(alt: 6000, code: :QNH)
41
+ subject = AIXM.vertical_limits(
42
+ upper_z: AIXM.z(65, :qne),
43
+ lower_z: AIXM.z(1000, :qfe),
44
+ max_z: AIXM.z(6000, :qnh)
45
45
  )
46
46
  subject.to_xml.must_equal <<~END
47
47
  <codeDistVerUpper>STD</codeDistVerUpper>
@@ -57,10 +57,10 @@ describe AIXM::Component::VerticalLimits do
57
57
  end
58
58
 
59
59
  it "must build correct XML with additional min_z" do
60
- subject = AIXM::Component::VerticalLimits.new(
61
- upper_z: AIXM::Z.new(alt: 65, code: :QNE),
62
- lower_z: AIXM::Z.new(alt: 45, code: :QNE),
63
- min_z: AIXM::Z.new(alt: 3000, code: :QNH)
60
+ subject = AIXM.vertical_limits(
61
+ upper_z: AIXM.z(65, :qne),
62
+ lower_z: AIXM.z(45, :qne),
63
+ min_z: AIXM.z(3000, :qnh)
64
64
  )
65
65
  subject.to_xml.must_equal <<~END
66
66
  <codeDistVerUpper>STD</codeDistVerUpper>
@@ -3,39 +3,39 @@ require_relative '../../spec_helper'
3
3
  describe AIXM::Document do
4
4
  describe :initialize do
5
5
  it "won't accept invalid arguments" do
6
- -> { AIXM::Document.new(created_at: 0) }.must_raise ArgumentError
7
- -> { AIXM::Document.new(created_at: 'foobar') }.must_raise ArgumentError
8
- -> { AIXM::Document.new(effective_at: 0) }.must_raise ArgumentError
9
- -> { AIXM::Document.new(effective_at: 'foobar') }.must_raise ArgumentError
6
+ -> { AIXM.document(created_at: 0) }.must_raise ArgumentError
7
+ -> { AIXM.document(created_at: 'foobar') }.must_raise ArgumentError
8
+ -> { AIXM.document(effective_at: 0) }.must_raise ArgumentError
9
+ -> { AIXM.document(effective_at: 'foobar') }.must_raise ArgumentError
10
10
  end
11
11
 
12
12
  it "must accept strings" do
13
13
  string = '2018-01-01 12:00:00 +0100'
14
- AIXM::Document.new(created_at: string).created_at.must_equal Time.parse(string)
15
- AIXM::Document.new(effective_at: string).effective_at.must_equal Time.parse(string)
14
+ AIXM.document(created_at: string).created_at.must_equal Time.parse(string)
15
+ AIXM.document(effective_at: string).effective_at.must_equal Time.parse(string)
16
16
  end
17
17
 
18
18
  it "must accept dates" do
19
19
  date = Date.parse('2018-01-01')
20
- AIXM::Document.new(created_at: date).created_at.must_equal date.to_time
21
- AIXM::Document.new(effective_at: date).effective_at.must_equal date.to_time
20
+ AIXM.document(created_at: date).created_at.must_equal date.to_time
21
+ AIXM.document(effective_at: date).effective_at.must_equal date.to_time
22
22
  end
23
23
 
24
24
  it "must accept times" do
25
25
  time = Time.parse('2018-01-01 12:00:00 +0100')
26
- AIXM::Document.new(created_at: time).created_at.must_equal time
27
- AIXM::Document.new(effective_at: time).effective_at.must_equal time
26
+ AIXM.document(created_at: time).created_at.must_equal time
27
+ AIXM.document(effective_at: time).effective_at.must_equal time
28
28
  end
29
29
 
30
30
  it "must accept nils" do
31
- AIXM::Document.new(created_at: nil).created_at.must_be :nil?
32
- AIXM::Document.new(effective_at: nil).effective_at.must_be :nil?
31
+ AIXM.document(created_at: nil).created_at.must_be :nil?
32
+ AIXM.document(effective_at: nil).effective_at.must_be :nil?
33
33
  end
34
34
  end
35
35
 
36
36
  context "incomplete" do
37
37
  subject do
38
- AIXM::Document.new
38
+ AIXM.document
39
39
  end
40
40
 
41
41
  it "must fail validation" do
@@ -62,9 +62,9 @@ describe AIXM::Document do
62
62
  <AIXM-Snapshot xmlns:xsi="http://www.aixm.aero/schema/4.5/AIXM-Snapshot.xsd" version="4.5" origin="AIXM #{AIXM::VERSION} Ruby gem" created="2018-01-18T12:00:00+01:00" effective="2018-01-18T12:00:00+01:00">
63
63
  <!-- Airspace: [D] POLYGON AIRSPACE -->
64
64
  <Ase>
65
- <AseUid mid="202650074">
65
+ <AseUid mid="367297292">
66
66
  <codeType>D</codeType>
67
- <codeId>202650074</codeId>
67
+ <codeId>367297292</codeId>
68
68
  </AseUid>
69
69
  <txtLocalType>POLYGON</txtLocalType>
70
70
  <txtName>POLYGON AIRSPACE</txtName>
@@ -88,9 +88,9 @@ describe AIXM::Document do
88
88
  </Ase>
89
89
  <Abd>
90
90
  <AbdUid>
91
- <AseUid mid="202650074">
91
+ <AseUid mid="367297292">
92
92
  <codeType>D</codeType>
93
- <codeId>202650074</codeId>
93
+ <codeId>367297292</codeId>
94
94
  </AseUid>
95
95
  </AbdUid>
96
96
  <Avx>
@@ -116,9 +116,9 @@ describe AIXM::Document do
116
116
  </Abd>
117
117
  <!-- Airspace: [D] CIRCLE AIRSPACE -->
118
118
  <Ase>
119
- <AseUid mid="646302629">
119
+ <AseUid mid="332058082">
120
120
  <codeType>D</codeType>
121
- <codeId>646302629</codeId>
121
+ <codeId>332058082</codeId>
122
122
  </AseUid>
123
123
  <txtLocalType>CIRCLE</txtLocalType>
124
124
  <txtName>CIRCLE AIRSPACE</txtName>
@@ -142,9 +142,9 @@ describe AIXM::Document do
142
142
  </Ase>
143
143
  <Abd>
144
144
  <AbdUid>
145
- <AseUid mid="646302629">
145
+ <AseUid mid="332058082">
146
146
  <codeType>D</codeType>
147
- <codeId>646302629</codeId>
147
+ <codeId>332058082</codeId>
148
148
  </AseUid>
149
149
  </AbdUid>
150
150
  <Avx>
@@ -156,19 +156,114 @@ describe AIXM::Document do
156
156
  <geoLongArc>0045300.00E</geoLongArc>
157
157
  </Avx>
158
158
  </Abd>
159
+ <!-- Navigational aid: [ICAO] DESIGNATED POINT NAVAID -->
160
+ <Dpn>
161
+ <DpnUid>
162
+ <codeId>DPN</codeId>
163
+ <geoLat>475133.00N</geoLat>
164
+ <geoLong>0073336.00E</geoLong>
165
+ </DpnUid>
166
+ <OrgUid/>
167
+ <txtName>DESIGNATED POINT NAVAID</txtName>
168
+ <codeDatum>WGE</codeDatum>
169
+ <codeType>ICAO</codeType>
170
+ <valElev>500</valElev>
171
+ <uomDistVer>FT</uomDistVer>
172
+ <txtRmk>designated point navaid</txtRmk>
173
+ </Dpn>
174
+ <!-- Navigational aid: [DME] DME NAVAID -->
175
+ <Dme>
176
+ <DmeUid>
177
+ <codeId>DME</codeId>
178
+ <geoLat>475133.00N</geoLat>
179
+ <geoLong>0073336.00E</geoLong>
180
+ </DmeUid>
181
+ <OrgUid/>
182
+ <txtName>DME NAVAID</txtName>
183
+ <codeChannel>95X</codeChannel>
184
+ <codeDatum>WGE</codeDatum>
185
+ <valElev>500</valElev>
186
+ <uomDistVer>FT</uomDistVer>
187
+ <txtRmk>dme navaid</txtRmk>
188
+ </Dme>
189
+ <!-- Navigational aid: [Marker] MARKER NAVAID -->
190
+ <Mkr>
191
+ <MkrUid>
192
+ <codeId>---</codeId>
193
+ <geoLat>475133.00N</geoLat>
194
+ <geoLong>0073336.00E</geoLong>
195
+ </MkrUid>
196
+ <OrgUid/>
197
+ <valFreq>75</valFreq>
198
+ <uomFreq>MHZ</uomFreq>
199
+ <txtName>MARKER NAVAID</txtName>
200
+ <codeDatum>WGE</codeDatum>
201
+ <valElev>500</valElev>
202
+ <uomDistVer>FT</uomDistVer>
203
+ <txtRmk>marker navaid</txtRmk>
204
+ </Mkr>
205
+ <!-- Navigational aid: [NDB] NDB NAVAID -->
206
+ <Ndb>
207
+ <NdbUid>
208
+ <codeId>NDB</codeId>
209
+ <geoLat>475133.00N</geoLat>
210
+ <geoLong>0073336.00E</geoLong>
211
+ </NdbUid>
212
+ <OrgUid/>
213
+ <txtName>NDB NAVAID</txtName>
214
+ <valFreq>555</valFreq>
215
+ <uomFreq>KHZ</uomFreq>
216
+ <codeDatum>WGE</codeDatum>
217
+ <valElev>500</valElev>
218
+ <uomDistVer>FT</uomDistVer>
219
+ <txtRmk>ndb navaid</txtRmk>
220
+ </Ndb>
221
+ <!-- Navigational aid: [VOR] VOR NAVAID -->
222
+ <Vor>
223
+ <VorUid>
224
+ <codeId>VOR</codeId>
225
+ <geoLat>475133.00N</geoLat>
226
+ <geoLong>0073336.00E</geoLong>
227
+ </VorUid>
228
+ <OrgUid/>
229
+ <txtName>VOR NAVAID</txtName>
230
+ <codeType>VOR</codeType>
231
+ <valFreq>111</valFreq>
232
+ <uomFreq>MHZ</uomFreq>
233
+ <codeTypeNorth>TRUE</codeTypeNorth>
234
+ <codeDatum>WGE</codeDatum>
235
+ <valElev>500</valElev>
236
+ <uomDistVer>FT</uomDistVer>
237
+ <txtRmk>vor navaid</txtRmk>
238
+ </Vor>
239
+ <!-- Navigational aid: [TACAN] TACAN NAVAID -->
240
+ <Tcn>
241
+ <TcnUid>
242
+ <codeId>TCN</codeId>
243
+ <geoLat>475133.00N</geoLat>
244
+ <geoLong>0073336.00E</geoLong>
245
+ </TcnUid>
246
+ <OrgUid/>
247
+ <txtName>TACAN NAVAID</txtName>
248
+ <codeChannel>29X</codeChannel>
249
+ <codeDatum>WGE</codeDatum>
250
+ <valElev>500</valElev>
251
+ <uomDistVer>FT</uomDistVer>
252
+ <txtRmk>tacan navaid</txtRmk>
253
+ </Tcn>
159
254
  </AIXM-Snapshot>
160
255
  END
161
256
  end
162
257
 
163
258
  it "must build correct XML with OFM extensions" do
164
- subject.to_xml(:OFM).must_equal <<~"END"
259
+ subject.to_xml(:ofm).must_equal <<~"END"
165
260
  <?xml version="1.0" encoding="UTF-8"?>
166
261
  <AIXM-Snapshot xmlns:xsi="http://www.aixm.aero/schema/4.5/AIXM-Snapshot.xsd" version="4.5 + OFM extensions of version 0.1" origin="AIXM #{AIXM::VERSION} Ruby gem" created="2018-01-18T12:00:00+01:00" effective="2018-01-18T12:00:00+01:00">
167
262
  <!-- Airspace: [D] POLYGON AIRSPACE -->
168
263
  <Ase xt_classLayersAvail="false">
169
- <AseUid mid="202650074" newEntity="true">
264
+ <AseUid mid="367297292" newEntity="true">
170
265
  <codeType>D</codeType>
171
- <codeId>202650074</codeId>
266
+ <codeId>367297292</codeId>
172
267
  </AseUid>
173
268
  <txtLocalType>POLYGON</txtLocalType>
174
269
  <txtName>POLYGON AIRSPACE</txtName>
@@ -193,9 +288,9 @@ describe AIXM::Document do
193
288
  </Ase>
194
289
  <Abd>
195
290
  <AbdUid>
196
- <AseUid mid="202650074" newEntity="true">
291
+ <AseUid mid="367297292" newEntity="true">
197
292
  <codeType>D</codeType>
198
- <codeId>202650074</codeId>
293
+ <codeId>367297292</codeId>
199
294
  </AseUid>
200
295
  </AbdUid>
201
296
  <Avx>
@@ -224,9 +319,9 @@ describe AIXM::Document do
224
319
  </Abd>
225
320
  <!-- Airspace: [D] CIRCLE AIRSPACE -->
226
321
  <Ase xt_classLayersAvail="false">
227
- <AseUid mid="646302629" newEntity="true">
322
+ <AseUid mid="332058082" newEntity="true">
228
323
  <codeType>D</codeType>
229
- <codeId>646302629</codeId>
324
+ <codeId>332058082</codeId>
230
325
  </AseUid>
231
326
  <txtLocalType>CIRCLE</txtLocalType>
232
327
  <txtName>CIRCLE AIRSPACE</txtName>
@@ -251,9 +346,9 @@ describe AIXM::Document do
251
346
  </Ase>
252
347
  <Abd>
253
348
  <AbdUid>
254
- <AseUid mid="646302629" newEntity="true">
349
+ <AseUid mid="332058082" newEntity="true">
255
350
  <codeType>D</codeType>
256
- <codeId>646302629</codeId>
351
+ <codeId>332058082</codeId>
257
352
  </AseUid>
258
353
  </AbdUid>
259
354
  <Avx>
@@ -265,6 +360,101 @@ describe AIXM::Document do
265
360
  <geoLongArc>4.88333333E</geoLongArc>
266
361
  </Avx>
267
362
  </Abd>
363
+ <!-- Navigational aid: [ICAO] DESIGNATED POINT NAVAID -->
364
+ <Dpn>
365
+ <DpnUid newEntity="true">
366
+ <codeId>DPN</codeId>
367
+ <geoLat>47.85916667N</geoLat>
368
+ <geoLong>7.56000000E</geoLong>
369
+ </DpnUid>
370
+ <OrgUid/>
371
+ <txtName>DESIGNATED POINT NAVAID</txtName>
372
+ <codeDatum>WGE</codeDatum>
373
+ <codeType>ICAO</codeType>
374
+ <valElev>500</valElev>
375
+ <uomDistVer>FT</uomDistVer>
376
+ <txtRmk>designated point navaid</txtRmk>
377
+ </Dpn>
378
+ <!-- Navigational aid: [DME] DME NAVAID -->
379
+ <Dme>
380
+ <DmeUid newEntity="true">
381
+ <codeId>DME</codeId>
382
+ <geoLat>47.85916667N</geoLat>
383
+ <geoLong>7.56000000E</geoLong>
384
+ </DmeUid>
385
+ <OrgUid/>
386
+ <txtName>DME NAVAID</txtName>
387
+ <codeChannel>95X</codeChannel>
388
+ <codeDatum>WGE</codeDatum>
389
+ <valElev>500</valElev>
390
+ <uomDistVer>FT</uomDistVer>
391
+ <txtRmk>dme navaid</txtRmk>
392
+ </Dme>
393
+ <!-- Navigational aid: [Marker] MARKER NAVAID -->
394
+ <Mkr>
395
+ <MkrUid newEntity="true">
396
+ <codeId>---</codeId>
397
+ <geoLat>47.85916667N</geoLat>
398
+ <geoLong>7.56000000E</geoLong>
399
+ </MkrUid>
400
+ <OrgUid/>
401
+ <valFreq>75</valFreq>
402
+ <uomFreq>MHZ</uomFreq>
403
+ <txtName>MARKER NAVAID</txtName>
404
+ <codeDatum>WGE</codeDatum>
405
+ <valElev>500</valElev>
406
+ <uomDistVer>FT</uomDistVer>
407
+ <txtRmk>marker navaid</txtRmk>
408
+ </Mkr>
409
+ <!-- Navigational aid: [NDB] NDB NAVAID -->
410
+ <Ndb>
411
+ <NdbUid newEntity="true">
412
+ <codeId>NDB</codeId>
413
+ <geoLat>47.85916667N</geoLat>
414
+ <geoLong>7.56000000E</geoLong>
415
+ </NdbUid>
416
+ <OrgUid/>
417
+ <txtName>NDB NAVAID</txtName>
418
+ <valFreq>555</valFreq>
419
+ <uomFreq>KHZ</uomFreq>
420
+ <codeDatum>WGE</codeDatum>
421
+ <valElev>500</valElev>
422
+ <uomDistVer>FT</uomDistVer>
423
+ <txtRmk>ndb navaid</txtRmk>
424
+ </Ndb>
425
+ <!-- Navigational aid: [VOR] VOR NAVAID -->
426
+ <Vor>
427
+ <VorUid newEntity="true">
428
+ <codeId>VOR</codeId>
429
+ <geoLat>47.85916667N</geoLat>
430
+ <geoLong>7.56000000E</geoLong>
431
+ </VorUid>
432
+ <OrgUid/>
433
+ <txtName>VOR NAVAID</txtName>
434
+ <codeType>VOR</codeType>
435
+ <valFreq>111</valFreq>
436
+ <uomFreq>MHZ</uomFreq>
437
+ <codeTypeNorth>TRUE</codeTypeNorth>
438
+ <codeDatum>WGE</codeDatum>
439
+ <valElev>500</valElev>
440
+ <uomDistVer>FT</uomDistVer>
441
+ <txtRmk>vor navaid</txtRmk>
442
+ </Vor>
443
+ <!-- Navigational aid: [TACAN] TACAN NAVAID -->
444
+ <Tcn>
445
+ <TcnUid newEntity="true">
446
+ <codeId>TCN</codeId>
447
+ <geoLat>47.85916667N</geoLat>
448
+ <geoLong>7.56000000E</geoLong>
449
+ </TcnUid>
450
+ <OrgUid/>
451
+ <txtName>TACAN NAVAID</txtName>
452
+ <codeChannel>29X</codeChannel>
453
+ <codeDatum>WGE</codeDatum>
454
+ <valElev>500</valElev>
455
+ <uomDistVer>FT</uomDistVer>
456
+ <txtRmk>tacan navaid</txtRmk>
457
+ </Tcn>
268
458
  </AIXM-Snapshot>
269
459
  END
270
460
  end