aixm 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +11 -0
- data/lib/aixm/component/geometry.rb +4 -2
- data/lib/aixm/component/geometry/arc.rb +1 -1
- data/lib/aixm/component/geometry/border.rb +1 -1
- data/lib/aixm/component/geometry/circle.rb +1 -1
- data/lib/aixm/component/geometry/point.rb +1 -1
- data/lib/aixm/component/layer.rb +6 -2
- data/lib/aixm/component/vertical_limits.rb +17 -14
- data/lib/aixm/constants.rb +1 -1
- data/lib/aixm/feature/address.rb +1 -1
- data/lib/aixm/feature/airspace.rb +1 -3
- data/lib/aixm/feature/obstacle.rb +89 -71
- data/lib/aixm/feature/obstacle_group.rb +71 -30
- data/lib/aixm/refinements.rb +15 -0
- data/lib/aixm/version.rb +1 -1
- data/lib/aixm/xy.rb +5 -0
- data/schemas/ofmx/0/OFMX-DataTypes.xsd +3 -1
- data/schemas/ofmx/0/OFMX-Features.xsd +79 -34
- data/schemas/ofmx/0/OFMX-Snapshot.xsd +1 -0
- data/spec/factory.rb +7 -9
- data/spec/lib/aixm/component/vertical_limits_spec.rb +8 -8
- data/spec/lib/aixm/document_spec.rb +81 -28
- data/spec/lib/aixm/feature/obstacle_group_spec.rb +87 -45
- data/spec/lib/aixm/feature/obstacle_spec.rb +34 -40
- data/spec/lib/aixm/refinements_spec.rb +16 -0
- data/spec/lib/aixm/xy_spec.rb +10 -0
- metadata +2 -2
@@ -50,11 +50,11 @@ describe AIXM::Feature::Obstacle do
|
|
50
50
|
|
51
51
|
describe :radius= do
|
52
52
|
it "fails on invalid values" do
|
53
|
-
[
|
53
|
+
[:foobar, 123, AIXM.d(0, :m)].wont_be_written_to subject, :radius
|
54
54
|
end
|
55
55
|
|
56
56
|
it "accepts valid values" do
|
57
|
-
[AIXM::Factory.d].must_be_written_to subject, :radius
|
57
|
+
[AIXM::Factory.d, nil].must_be_written_to subject, :radius
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
@@ -182,23 +182,24 @@ describe AIXM::Feature::Obstacle do
|
|
182
182
|
macro :remarks
|
183
183
|
end
|
184
184
|
|
185
|
-
describe :
|
186
|
-
it "returns false
|
187
|
-
subject.
|
185
|
+
describe :grouped? do
|
186
|
+
it "returns false since single obstacles are not grouped" do
|
187
|
+
subject.wont_be :grouped?
|
188
188
|
end
|
189
|
+
end
|
189
190
|
|
190
|
-
|
191
|
-
|
191
|
+
describe :linked? do
|
192
|
+
subject do
|
193
|
+
AIXM::Factory.unlinked_obstacle_group.obstacles.first
|
192
194
|
end
|
193
195
|
|
194
|
-
it "returns false
|
195
|
-
subject.
|
196
|
+
it "returns false for unlinked obstacles" do
|
197
|
+
subject.wont_be :linked?
|
196
198
|
end
|
197
|
-
end
|
198
199
|
|
199
|
-
|
200
|
-
|
201
|
-
subject.
|
200
|
+
it "returns true for linked obstacles" do
|
201
|
+
subject = AIXM::Factory.linked_obstacle_group.obstacles.last
|
202
|
+
subject.must_be :linked?
|
202
203
|
end
|
203
204
|
end
|
204
205
|
|
@@ -232,24 +233,40 @@ describe AIXM::Feature::Obstacle do
|
|
232
233
|
it "builds correct OFMX" do
|
233
234
|
AIXM.ofmx!
|
234
235
|
subject.to_xml.must_equal <<~END
|
236
|
+
<!-- Obstacle group: EIFFEL TOWER -->
|
237
|
+
<Ogr>
|
238
|
+
<OgrUid>
|
239
|
+
<txtName>EIFFEL TOWER</txtName>
|
240
|
+
<geoLat>48.85825000N</geoLat>
|
241
|
+
<geoLong>002.29458889E</geoLong>
|
242
|
+
</OgrUid>
|
243
|
+
<codeDatum>WGE</codeDatum>
|
244
|
+
<valGeoAccuracy>2</valGeoAccuracy>
|
245
|
+
<uomGeoAccuracy>M</uomGeoAccuracy>
|
246
|
+
<valElevAccuracy>3</valElevAccuracy>
|
247
|
+
<uomElevAccuracy>FT</uomElevAccuracy>
|
248
|
+
</Ogr>
|
235
249
|
<!-- Obstacle: [tower] 48.85825000N 002.29458889E EIFFEL TOWER -->
|
236
250
|
<Obs>
|
237
251
|
<ObsUid>
|
252
|
+
<OgrUid>
|
253
|
+
<txtName>EIFFEL TOWER</txtName>
|
254
|
+
<geoLat>48.85825000N</geoLat>
|
255
|
+
<geoLong>002.29458889E</geoLong>
|
256
|
+
</OgrUid>
|
238
257
|
<geoLat>48.85825000N</geoLat>
|
239
258
|
<geoLong>002.29458889E</geoLong>
|
240
259
|
</ObsUid>
|
241
260
|
<txtName>EIFFEL TOWER</txtName>
|
242
261
|
<codeType>TOWER</codeType>
|
262
|
+
<codeGroup>N</codeGroup>
|
243
263
|
<codeLgt>Y</codeLgt>
|
244
264
|
<txtDescrLgt>red strobes</txtDescrLgt>
|
245
265
|
<codeDatum>WGE</codeDatum>
|
246
|
-
<valGeoAccuracy>2</valGeoAccuracy>
|
247
|
-
<uomGeoAccuracy>M</uomGeoAccuracy>
|
248
266
|
<valElev>1187</valElev>
|
249
|
-
<valElevAccuracy>3</valElevAccuracy>
|
250
267
|
<valHgt>1063</valHgt>
|
251
|
-
<codeHgtAccuracy>Y</codeHgtAccuracy>
|
252
268
|
<uomDistVer>FT</uomDistVer>
|
269
|
+
<codeHgtAccuracy>Y</codeHgtAccuracy>
|
253
270
|
<valRadius>88</valRadius>
|
254
271
|
<uomRadius>M</uomRadius>
|
255
272
|
<datetimeValidWef>2018-01-01T12:00:00+01:00</datetimeValidWef>
|
@@ -260,26 +277,3 @@ describe AIXM::Feature::Obstacle do
|
|
260
277
|
end
|
261
278
|
end
|
262
279
|
end
|
263
|
-
|
264
|
-
describe AIXM::Feature::Obstacle::Grouped do
|
265
|
-
subject do
|
266
|
-
AIXM::Factory.unlinked_obstacle_group.obstacles.first
|
267
|
-
end
|
268
|
-
|
269
|
-
describe :grouped? do
|
270
|
-
it "returns true since obstacles are grouped" do
|
271
|
-
subject.must_be :grouped?
|
272
|
-
end
|
273
|
-
end
|
274
|
-
|
275
|
-
describe :linked? do
|
276
|
-
it "returns false for unlinked obstacles" do
|
277
|
-
subject.wont_be :linked?
|
278
|
-
end
|
279
|
-
|
280
|
-
it "returns true for linked obstacles" do
|
281
|
-
subject = AIXM::Factory.linked_obstacle_group.obstacles.last
|
282
|
-
subject.must_be :linked?
|
283
|
-
end
|
284
|
-
end
|
285
|
-
end
|
@@ -4,6 +4,22 @@ using AIXM::Refinements
|
|
4
4
|
|
5
5
|
describe AIXM::Refinements do
|
6
6
|
|
7
|
+
context Object do
|
8
|
+
describe :then_if do
|
9
|
+
subject do
|
10
|
+
"foobar"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "must return self if the condition is false" do
|
14
|
+
subject.then_if(false) { |s| s.gsub(/o/, 'i') }.must_equal subject
|
15
|
+
end
|
16
|
+
|
17
|
+
it "must return apply the block if the condition is true" do
|
18
|
+
subject.then_if(true) { |s| s.gsub(/o/, 'i') }.must_equal 'fiibar'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
7
23
|
context Array do
|
8
24
|
describe :to_digest do
|
9
25
|
it "must digest single string" do
|
data/spec/lib/aixm/xy_spec.rb
CHANGED
@@ -111,6 +111,16 @@ describe AIXM::XY do
|
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
|
+
describe :to_point do
|
115
|
+
subject do
|
116
|
+
AIXM.xy(lat: %q(44°00'07.63"N), long: %q(004°45'07.81"E))
|
117
|
+
end
|
118
|
+
|
119
|
+
it "must return a point object with these coordinates" do
|
120
|
+
subject.to_point.xy.must_equal AIXM.point(xy: subject).xy
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
114
124
|
describe :distance do
|
115
125
|
subject do
|
116
126
|
AIXM.xy(lat: %q(44°00'07.63"N), long: %q(004°45'07.81"E))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aixm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Schwyn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|