aixm 0.2.0 → 0.2.1
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/CHANGELOG.md +10 -0
- data/README.md +149 -116
- data/lib/aixm/component/class_layer.rb +3 -3
- data/lib/aixm/component/geometry.rb +3 -3
- data/lib/aixm/component/geometry/arc.rb +2 -2
- data/lib/aixm/component/geometry/border.rb +2 -2
- data/lib/aixm/component/geometry/circle.rb +2 -2
- data/lib/aixm/component/geometry/point.rb +2 -2
- data/lib/aixm/component/schedule.rb +2 -2
- data/lib/aixm/component/vertical_limits.rb +2 -2
- data/lib/aixm/document.rb +4 -4
- data/lib/aixm/feature/airspace.rb +42 -17
- data/lib/aixm/feature/navigational_aid/base.rb +41 -8
- data/lib/aixm/feature/navigational_aid/designated_point.rb +29 -15
- data/lib/aixm/feature/navigational_aid/dme.rb +32 -9
- data/lib/aixm/feature/navigational_aid/marker.rb +25 -7
- data/lib/aixm/feature/navigational_aid/ndb.rb +25 -9
- data/lib/aixm/feature/navigational_aid/tacan.rb +21 -20
- data/lib/aixm/feature/navigational_aid/vor.rb +66 -26
- data/lib/aixm/version.rb +1 -1
- data/spec/factory.rb +69 -13
- data/spec/lib/aixm/component/class_layer_spec.rb +4 -4
- data/spec/lib/aixm/component/geometry/arc_spec.rb +3 -3
- data/spec/lib/aixm/component/geometry/border_spec.rb +2 -2
- data/spec/lib/aixm/component/geometry/circle_spec.rb +3 -3
- data/spec/lib/aixm/component/geometry/point_spec.rb +3 -3
- data/spec/lib/aixm/component/geometry_spec.rb +4 -4
- data/spec/lib/aixm/component/schedule_spec.rb +2 -2
- data/spec/lib/aixm/component/vertical_limits_spec.rb +4 -4
- data/spec/lib/aixm/document_spec.rb +282 -28
- data/spec/lib/aixm/feature/airspace_spec.rb +14 -10
- data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +9 -6
- data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +9 -6
- data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +7 -4
- data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +9 -6
- data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +9 -6
- data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +156 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 486dafa5ec46b76f70a12053bdc29606c563136106cd25ffafc62906decec9e4
|
4
|
+
data.tar.gz: f154584ca3cc854eec2e715b76ff379b689ed51a0bd7887979445b3733a3e0d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68808eefa33113f2e57c5376156c5395711c80f447e9cb03584076d45f043b102f213450e6e2f438ec4a0480eff10708605c6bb623bcba2a55d629241a4d4a7a
|
7
|
+
data.tar.gz: 148345f24a85d5e5636d93175ea516c1266bd5277f0a13c301acb8762155f349a80a095c33856b8ff8234826e3301409b73b7b8fb681ac872463a8d9e596e272
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## 0.2.1
|
2
|
+
|
3
|
+
* Major changes:
|
4
|
+
* Fix DVOR and VORDME confusion
|
5
|
+
* Add schedule to navigational aids
|
6
|
+
* VOR can be associated with DME (-> VOR/DME) or TACAN (-> VORTAC) now
|
7
|
+
* `to_xml` has been renamed to `to_aixm` everywhere
|
8
|
+
* Minor changes:
|
9
|
+
* Remove :other from all value lists
|
10
|
+
|
1
11
|
## 0.2.0
|
2
12
|
|
3
13
|
* Additions:
|
data/README.md
CHANGED
@@ -6,12 +6,9 @@
|
|
6
6
|
|
7
7
|
# AIXM
|
8
8
|
|
9
|
-
Partial implementation of the [Aeronautical Information Exchange Model (AIXM 4.5)](http://aixm.aero)
|
10
|
-
for Ruby.
|
9
|
+
Partial implementation of the [Aeronautical Information Exchange Model (AIXM 4.5)](http://aixm.aero) for Ruby.
|
11
10
|
|
12
|
-
For now, only the parts needed to automize the AIP import of [Open Flightmaps](https://openflightmaps.org)
|
13
|
-
are part of this gem. Most notably, the gem is only a builder of AIXM 4.5
|
14
|
-
snapshot files and does not parse them.
|
11
|
+
For now, only the parts needed to automize the AIP import of [Open Flightmaps](https://openflightmaps.org) are part of this gem. Most notably, the gem is only a builder of AIXM 4.5 snapshot files and does not parse them.
|
15
12
|
|
16
13
|
* [Homepage](https://github.com/svoop/aixm)
|
17
14
|
* [API](http://www.rubydoc.info/gems/aixm)
|
@@ -27,8 +24,7 @@ gem aixm
|
|
27
24
|
|
28
25
|
## Usage
|
29
26
|
|
30
|
-
You can initialize all elements either traditionally or by use of shorter
|
31
|
-
AIXM class methods:
|
27
|
+
You can initialize all elements either traditionally or by use of shorter AIXM class methods:
|
32
28
|
|
33
29
|
```ruby
|
34
30
|
AIXM.airspace(...)
|
@@ -41,26 +37,24 @@ All fundamentals are subclasses of `AIXM::Base`.
|
|
41
37
|
|
42
38
|
### Document
|
43
39
|
|
44
|
-
The document is the root container of the AIXM snapshot file to be generated.
|
45
|
-
It's essentially a collection of features:
|
40
|
+
The document is the root container of the AIXM snapshot file to be generated. It's essentially a collection of features:
|
46
41
|
|
47
42
|
```ruby
|
48
43
|
document = AIXM.document(created_at: Time.now, effective_at: Time.now)
|
49
44
|
document.features << AIXM.airspace(...)
|
50
45
|
```
|
51
46
|
|
52
|
-
To give an overview of the AIXM building blocks, the remainder of this guide
|
53
|
-
will list initializer arguments with colons (`name: class`) and attribute
|
54
|
-
writers with equal or push signs (`name = class` or `name << class`):
|
47
|
+
To give you an overview of the AIXM building blocks, the remainder of this guide will use pseudo code to describe the initializer arguments, writer methods etc:
|
55
48
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
49
|
+
```ruby
|
50
|
+
document = AIXM.document(
|
51
|
+
created_at: Time or Date or String
|
52
|
+
effective_at: Time or Date or String
|
53
|
+
)
|
54
|
+
document.features << AIXM::Feature
|
55
|
+
```
|
60
56
|
|
61
|
-
See [the API documentation](http://www.rubydoc.info/gems/aixm) for details and
|
62
|
-
[spec/factory.rb](https://github.com/svoop/aixm/blob/master/spec/factory.rb) for
|
63
|
-
examples.
|
57
|
+
See [the API documentation](http://www.rubydoc.info/gems/aixm) for details and [spec/factory.rb](https://github.com/svoop/aixm/blob/master/spec/factory.rb) for examples.
|
64
58
|
|
65
59
|
#### Coordinate
|
66
60
|
|
@@ -94,77 +88,109 @@ All features are subclasses of `AIXM::Feature::Base`.
|
|
94
88
|
|
95
89
|
#### Airspace
|
96
90
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
91
|
+
```ruby
|
92
|
+
airspace = AIXM.airspace(
|
93
|
+
name: String
|
94
|
+
short_name: String or nil
|
95
|
+
type: String or Symbol
|
96
|
+
)
|
97
|
+
airspace.schedule = AIXM.schedule
|
98
|
+
airspace.geometry << AIXM.point or AIXM.arc or AIXM.border or AIXM.circle
|
99
|
+
airspace.class_layers << AIXM.class_layer
|
100
|
+
airspace.remarks = String
|
101
|
+
```
|
105
102
|
|
106
103
|
#### Navigational Aids
|
107
104
|
|
108
105
|
##### Designated Point
|
109
106
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
107
|
+
```ruby
|
108
|
+
designated_point = AIXM.designated_point(
|
109
|
+
id: String
|
110
|
+
name: String
|
111
|
+
xy: AIXM.xy
|
112
|
+
z: AIXM.z or nil
|
113
|
+
type: :icao or :adhp, or :coordinates
|
114
|
+
)
|
115
|
+
designated_point.schedule = AIXM.schedule
|
116
|
+
designated_point.remarks = String
|
117
|
+
```
|
117
118
|
|
118
119
|
##### DME
|
119
120
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
121
|
+
```ruby
|
122
|
+
dme = AIXM.dme(
|
123
|
+
id: String
|
124
|
+
name: String
|
125
|
+
xy: AIXM.xy
|
126
|
+
z: AIXM.z or nil
|
127
|
+
channel: String
|
128
|
+
)
|
129
|
+
dme.schedule = AIXM.schedule
|
130
|
+
dme.remarks = String
|
131
|
+
```
|
127
132
|
|
128
133
|
##### NDB
|
129
134
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
135
|
+
```ruby
|
136
|
+
ndb = AIXM.ndb(
|
137
|
+
id: String
|
138
|
+
name: String
|
139
|
+
xy: AIXM.xy
|
140
|
+
z: AIXM.z or nil
|
141
|
+
f: AIXM.f
|
142
|
+
)
|
143
|
+
ndb.schedule = AIXM.schedule
|
144
|
+
ndb.remarks = String
|
145
|
+
```
|
137
146
|
|
138
147
|
##### Marker
|
139
148
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
149
|
+
WARNING: Marker are not fully implemented because they usually have to be
|
150
|
+
associated with ILS which are not yet implemented.
|
151
|
+
|
152
|
+
```ruby
|
153
|
+
marker = AIXM.marker(
|
154
|
+
id: String
|
155
|
+
name: String
|
156
|
+
xy: AIXM.xy
|
157
|
+
z: AIXM.z or nil
|
158
|
+
)
|
159
|
+
marker.schedule = AIXM.schedule
|
160
|
+
marker.remarks = String
|
161
|
+
```
|
146
162
|
|
147
163
|
##### TACAN
|
148
164
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
165
|
+
```ruby
|
166
|
+
tacan = AIXM.tacan(
|
167
|
+
id: String
|
168
|
+
name: String
|
169
|
+
xy: AIXM.xy
|
170
|
+
z: AIXM.z or nil
|
171
|
+
channel: String
|
172
|
+
)
|
173
|
+
tacan.schedule = AIXM.schedule
|
174
|
+
tacan.remarks = String
|
175
|
+
```
|
176
|
+
|
177
|
+
##### VOR
|
178
|
+
|
179
|
+
```ruby
|
180
|
+
vor = AIXM.vor(
|
181
|
+
id: String
|
182
|
+
name: String
|
183
|
+
xy: AIXM.xy
|
184
|
+
z: AIXM.z or nil
|
185
|
+
type: :vor or :doppler_vor
|
186
|
+
f: AIXM.f
|
187
|
+
north: :geographic or :grid or :magnetic
|
188
|
+
)
|
189
|
+
vor.schedule = AIXM.schedule
|
190
|
+
vor.remarks = String
|
191
|
+
vor.associate_dme(channel: String) # turns the VOR into a VOR/DME
|
192
|
+
vor.associate_tacan(channel: String) # turns the VOR into a VORTAC
|
193
|
+
```
|
168
194
|
|
169
195
|
### Components
|
170
196
|
|
@@ -172,66 +198,78 @@ All components are subclasses of `AIXM::Component::Base`.
|
|
172
198
|
|
173
199
|
#### Schedule
|
174
200
|
|
175
|
-
|
176
|
-
|
201
|
+
```ruby
|
202
|
+
schedule = AIXM.schedule(
|
203
|
+
code: String or Symbol
|
204
|
+
)
|
205
|
+
```
|
177
206
|
|
178
207
|
#### Class Layer
|
179
208
|
|
180
|
-
|
181
|
-
|
182
|
-
|
209
|
+
```ruby
|
210
|
+
class_layer = AIXM.class_layer(
|
211
|
+
class: String or nil
|
212
|
+
vertical_limits: AIXM.vertical_limits
|
213
|
+
)
|
214
|
+
```
|
183
215
|
|
184
216
|
#### Vertical Limits
|
185
217
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
218
|
+
```ruby
|
219
|
+
vertical_limits = AIXM.vertical_limits(
|
220
|
+
max_z: AIXM.z or nil
|
221
|
+
upper_z: AIXM.z
|
222
|
+
lower_z: AIXM.z
|
223
|
+
min_z: AIXM.z or nil
|
224
|
+
)
|
225
|
+
```
|
191
226
|
|
192
227
|
#### Point, Arc, Border and Circle
|
193
228
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
229
|
+
```ruby
|
230
|
+
point = AIXM.point(
|
231
|
+
xy: AIXM.xy
|
232
|
+
)
|
233
|
+
arc = AIXM.arc(
|
234
|
+
xy: AIXM.xy
|
235
|
+
center_xy: AIXM.xy
|
236
|
+
cloclwise: true or false
|
237
|
+
)
|
238
|
+
border = AIXM.border(
|
239
|
+
xy: AIXM.xy
|
240
|
+
name: String
|
241
|
+
)
|
242
|
+
circle = AIXM.circle(
|
243
|
+
center_xy: AIXM.xy
|
244
|
+
radius: Numeric
|
245
|
+
)
|
246
|
+
```
|
206
247
|
|
207
248
|
#### Geometry
|
208
249
|
|
209
|
-
|
210
|
-
|
250
|
+
```ruby
|
251
|
+
geometry = AIXM.geometry
|
252
|
+
geometry << AIXM.point or AIXM.arc or AIXM.border or AIXM.circle
|
253
|
+
```
|
211
254
|
|
212
255
|
For a geometry to be complete, it must be comprised of either:
|
213
256
|
|
214
257
|
* exactly one circle
|
215
|
-
* at least three points, arcs or borders (the last of which a point with
|
216
|
-
identical coordinates as the first)
|
258
|
+
* at least three points, arcs or borders (the last of which a point with identical coordinates as the first)
|
217
259
|
|
218
260
|
## Validation
|
219
261
|
|
220
|
-
Use `AIXM::Document#complete?` to check whether all mandatory information is
|
221
|
-
present. Airspaces, geometries etc have `complete?` methods as well.
|
262
|
+
Use `AIXM::Document#complete?` to check whether all mandatory information is present. Airspaces, geometries etc have `complete?` methods as well.
|
222
263
|
|
223
|
-
Use `AIXM::Document#valid?` to validate the resulting AIXM against the XSD
|
224
|
-
schema. If any, you find the errors in `AIXM::Document#errors`. Since the data
|
225
|
-
model is not fully implemented, some associations cannot be assigned and have
|
226
|
-
to be left empty. The resulting validation errors are silently ignored:
|
264
|
+
Use `AIXM::Document#valid?` to validate the resulting AIXM against the XSD schema. If any, you find the errors in `AIXM::Document#errors`. Since the data model is not fully implemented, some associations cannot be assigned and have to be left empty. The resulting validation errors are silently ignored:
|
227
265
|
|
228
266
|
* OrgUid - organizations may be empty tags
|
229
267
|
|
230
268
|
## Rendering
|
231
269
|
|
232
270
|
```ruby
|
233
|
-
document.
|
234
|
-
document.
|
271
|
+
document.to_aixm # render AIXM 4.5 compliant XML
|
272
|
+
document.to_aixm(:ofm) # render AIXM 4.5 + OFM extensions XML
|
235
273
|
```
|
236
274
|
|
237
275
|
## Constants
|
@@ -252,16 +290,13 @@ By `using AIXM::Refinements` you get the following general purpose methods:
|
|
252
290
|
* `Float#trim`<br>Convert whole numbers to Integer and leave all other untouched
|
253
291
|
* `Float#to_km(from: unit)`<br>Convert a distance from *unit* (:km, :m, :nm or :ft) to km
|
254
292
|
|
255
|
-
See the [source code](https://github.com/svoop/aixm/blob/master/lib/aixm/refinements.rb)
|
256
|
-
for more explicit descriptions and examples.
|
293
|
+
See the [source code](https://github.com/svoop/aixm/blob/master/lib/aixm/refinements.rb) for more explicit descriptions and examples.
|
257
294
|
|
258
295
|
## Extensions
|
259
296
|
|
260
297
|
### OFM
|
261
298
|
|
262
|
-
This extension adds proprietary tags and attributes (most of which are prefixed
|
263
|
-
with `xt_`) aiming to improve importing the resulting AIXM into the OFM
|
264
|
-
originative suite:
|
299
|
+
This extension adds proprietary tags and attributes (most of which are prefixed with `xt_`) aiming to improve importing the resulting AIXM into the OFM originative suite:
|
265
300
|
|
266
301
|
* `<AIXM-Snapshot version="4.5 + OFM extensions of version 0.1" (...) />`<br>root node with extended version string
|
267
302
|
* `<Ase xt_classLayersAvail="(true|false)">`<br>true when multiple class layers and therefore an Adg-node is present
|
@@ -278,8 +313,7 @@ originative suite:
|
|
278
313
|
|
279
314
|
## Tests
|
280
315
|
|
281
|
-
Some tests are very time consuming and therefore skipped by default. To run the
|
282
|
-
full test suite, set the environment variable:
|
316
|
+
Some tests are very time consuming and therefore skipped by default. To run the full test suite, set the environment variable:
|
283
317
|
|
284
318
|
```
|
285
319
|
export SPEC_SCOPE=all
|
@@ -299,8 +333,7 @@ Please submit issues on:
|
|
299
333
|
|
300
334
|
https://github.com/svoop/aixm/issues
|
301
335
|
|
302
|
-
To contribute code, fork the project on Github, add your code and submit a
|
303
|
-
pull request:
|
336
|
+
To contribute code, fork the project on Github, add your code and submit a pull request:
|
304
337
|
|
305
338
|
https://help.github.com/articles/fork-a-repo
|
306
339
|
|
@@ -33,11 +33,11 @@ module AIXM
|
|
33
33
|
end
|
34
34
|
|
35
35
|
##
|
36
|
-
# Render AIXM
|
37
|
-
def
|
36
|
+
# Render AIXM markup
|
37
|
+
def to_aixm(*extensions)
|
38
38
|
builder = Builder::XmlMarkup.new(indent: 2)
|
39
39
|
builder.codeClass(self.class.to_s) if self.class
|
40
|
-
builder << vertical_limits.
|
40
|
+
builder << vertical_limits.to_aixm(*extensions)
|
41
41
|
builder.target! # see https://github.com/jimweirich/builder/issues/42
|
42
42
|
end
|
43
43
|
end
|
@@ -46,9 +46,9 @@ module AIXM
|
|
46
46
|
end
|
47
47
|
|
48
48
|
##
|
49
|
-
# Render AIXM
|
50
|
-
def
|
51
|
-
@result_array.map { |h| h.
|
49
|
+
# Render AIXM markup
|
50
|
+
def to_aixm(*extensions)
|
51
|
+
@result_array.map { |h| h.to_aixm(*extensions) }.join
|
52
52
|
end
|
53
53
|
|
54
54
|
private
|