aixm 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +5 -0
  5. data/CHANGELOG.md +14 -0
  6. data/Gemfile +3 -0
  7. data/Guardfile +7 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +100 -0
  10. data/Rakefile +12 -0
  11. data/aixm.gemspec +32 -0
  12. data/lib/aixm.rb +25 -0
  13. data/lib/aixm/constants.rb +6 -0
  14. data/lib/aixm/document.rb +65 -0
  15. data/lib/aixm/feature/airspace.rb +74 -0
  16. data/lib/aixm/geometry.rb +71 -0
  17. data/lib/aixm/horizontal/arc.rb +50 -0
  18. data/lib/aixm/horizontal/border.rb +45 -0
  19. data/lib/aixm/horizontal/circle.rb +53 -0
  20. data/lib/aixm/horizontal/point.rb +39 -0
  21. data/lib/aixm/refinements.rb +61 -0
  22. data/lib/aixm/schemas/4.5/AIXM-DataTypes.xsd +5231 -0
  23. data/lib/aixm/schemas/4.5/AIXM-Features.xsd +10066 -0
  24. data/lib/aixm/schemas/4.5/AIXM-Snapshot.xsd +352 -0
  25. data/lib/aixm/version.rb +3 -0
  26. data/lib/aixm/vertical/limits.rb +59 -0
  27. data/lib/aixm/xy.rb +52 -0
  28. data/lib/aixm/z.rb +39 -0
  29. data/spec/factory.rb +66 -0
  30. data/spec/lib/aixm/document_spec.rb +211 -0
  31. data/spec/lib/aixm/feature/airspace_spec.rb +96 -0
  32. data/spec/lib/aixm/geometry_spec.rb +218 -0
  33. data/spec/lib/aixm/horizontal/arc_spec.rb +69 -0
  34. data/spec/lib/aixm/horizontal/border_spec.rb +47 -0
  35. data/spec/lib/aixm/horizontal/circle_spec.rb +65 -0
  36. data/spec/lib/aixm/horizontal/point_spec.rb +42 -0
  37. data/spec/lib/aixm/refinements_spec.rb +180 -0
  38. data/spec/lib/aixm/version_spec.rb +7 -0
  39. data/spec/lib/aixm/vertical/limits_spec.rb +78 -0
  40. data/spec/lib/aixm/xy_spec.rb +131 -0
  41. data/spec/lib/aixm/z_spec.rb +59 -0
  42. data/spec/sounds/failure.mp3 +0 -0
  43. data/spec/sounds/success.mp3 +0 -0
  44. data/spec/spec_helper.rb +28 -0
  45. metadata +243 -0
@@ -0,0 +1,352 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ ************************************************************************************************
4
+
5
+ Project: AERONAUTICAL INFORMATION EXCHANGE MODEL (AIXM)
6
+ Owner: EUROCONTROL
7
+ Title: AIXM Exchange Format
8
+
9
+ Creation details
10
+ ================
11
+ Author: EUROCONTROL
12
+ Address: Rue de la Fusee, 96, B-1130 Brussels, Belgium
13
+ Tel: +32 2 729 3326
14
+ URL: http://www.eurocontrol.int/ais/aixm
15
+
16
+
17
+ File Name: AIXM-Snapshot.xsd
18
+
19
+ Summary: definition of AIXM snapshot (report) messages;
20
+
21
+ Use: systems implementing the AIXM exchange format
22
+
23
+ Copyright (c) 2006, EUROCONTROL
24
+ ===============================
25
+ All rights reserved.
26
+
27
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
28
+
29
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
30
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
31
+ * Neither the name of EUROCONTROL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
32
+
33
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ ==========================================
35
+ Editorial note: this license is an instance of the BSD license template as provided by the Open Source Initiative: http://www.opensource.org/licenses/bsd-license.php
36
+
37
+ Date Version Who Comment
38
+ ========== ======= ====== ==========================================================================
39
+ 2006-10-09 4.5-r2 EPR Bugs correction:
40
+ - added double 'l' in 'collocation' in AerodromeHeliportCollocationType and AerodromeHeliportCollocationUidType
41
+ - removed letter 't' from NavaidDistanceIndicationtType
42
+ 2006-03-10 4.5-r1 EPR Bugs correction:
43
+ - no change in this file
44
+ 2005-11-17 4.5 XVI Proposed version, starting from the previous version
45
+ Changes are:
46
+ - AIXM Change Description 4.0-1: no impact
47
+ - AIXM Change Description 4.0-2: no impact
48
+ - AIXM Change Description 4.0-3: no impact
49
+ - AIXM Change Description 4.0-4: no impact
50
+ - AIXM Change Description 4.0-5: no impact
51
+ - AIXM Change Description 4.0-6: no impact
52
+ - AIXM Change Description 4.0-7: no impact
53
+ - AIXM Change Description 4.0-8: no impact
54
+ - AIXM Change Description 4.0-9: no impact
55
+ - AIXM Change Description 4.0-10: no impact
56
+ - AIXM Change Description 4.0-11: no impact
57
+ - AIXM Change Description 4.0-12: no impact
58
+ - AIXM Change Description 4.0-13: no impact
59
+ - AIXM Change Description 4.0-14: no impact
60
+ - AIXM Change Description 4.0-15: no impact
61
+ - AIXM Change Description 4.0-16: no impact
62
+ - AIXM Change Description 4.0-17: no impact
63
+ - AIXM Change Description 4.0-18: no impact
64
+ - AIXM Change Description 4.0-19: no impact
65
+ - AIXM Change Description 4.0-20: no impact
66
+ - AIXM Change Description 4.0-21: no impact
67
+ - AIXM Change Description 4.0-22: no impact
68
+ - AIXM Change Description 4.0-23: Fao is deprecated and replaced by Fto
69
+ - AIXM Change Description 4.0-24: no impact
70
+ - AIXM Change Description 4.0-25: no impact
71
+ - AIXM Change Description 4.0-26: added Als element
72
+ - AIXM Change Description 4.0-27: no impact
73
+ - AIXM Change Description 4.0-28: no impact
74
+ - AIXM Change Description 4.0-29: added Oxg element
75
+ - AIXM Change Description 4.0-30: added Ntg element
76
+ - AIXM Change Description 4.0-31: no impact
77
+ - AIXM Change Description 4.0-32: no impact
78
+ - AIXM Change Description 4.0-33: no impact
79
+ - AIXM Change Description 4.0-34: no impact
80
+ - AIXM Change Description 4.0-35: no impact
81
+ - AIXM Change Description 4.0-36: no impact
82
+ - AIXM Change Description 4.0-37: no impact
83
+ - AIXM Change Description 4.0-38: no impact
84
+ - AIXM Change Description 4.0-39: no impact
85
+ - AIXM Change Description 4.0-40: no impact
86
+ - AIXM Change Description 4.0-41: no impact
87
+ - AIXM Change Description 4.0-42: no impact
88
+ - AIXM Change Description 4.0-43: no impact
89
+ - AIXM Change Description 4.0-44: no impact
90
+ - AIXM Change Description 4.0-45: no impact
91
+ - AIXM Change Description 4.0-46: no impact
92
+ - AIXM Change Description 4.0-47: no impact
93
+ - AIXM Change Description 4.0-48: no impact
94
+ 2004-12-30 4.0a SHE Proposed version, starting from the previous version
95
+ Changes are:
96
+ - changed version number to 4.0a (proposed version 4.0 - alpha)
97
+ - AIXM Change Description 3.3-1.: no impact
98
+ - AIXM Change Description 3.3-2.: no impact
99
+ - AIXM Change Description 3.3-3.: no impact
100
+ - AIXM Change Description 3.3-4.: no impact
101
+ - AIXM Change Description 3.3-5.: no impact
102
+ - AIXM Change Description 3.3-6.: no impact
103
+ - AIXM Change Description 3.3-7.:
104
+ Aas and Adg are added in list of features
105
+ Aac is marked as "Deprecated"
106
+ - AIXM Change Description 3.3-8.: no impact
107
+ - AIXM Change Description 3.3-9.: no impact
108
+ - AIXM Change Description 3.3-10.: no impact
109
+ - AIXM Change Description 3.3-11.: no impact
110
+ - AIXM Change Description 3.3-12.: no impact
111
+ - AIXM Change Description 3.3-13.: no impact
112
+ - AIXM Change Description 3.3-14.: no impact
113
+ - AIXM Change Description 3.3-15.: no impact
114
+ - AIXM Change Description 3.3-16.: no impact
115
+ - AIXM Change Description 3.3-17.: no impact
116
+ - AIXM Change Description 3.3-18.: no impact
117
+ - AIXM Change Description 3.3-19.: no impact
118
+ - AIXM Change Description 3.3-20.: no impact
119
+ - AIXM Change Description 3.3-21.:
120
+ Tli, Vli, Dli and Nli are added in the list of features
121
+ Tln, Vln, Dln, Nln are marked as "Deprecated"
122
+ - AIXM Change Description 3.3-22.: no impact
123
+ Acr is added in the list of features
124
+ - AIXM Change Description 3.3-23.: no impact
125
+ - AIXM Change Description 3.3-24.: no impact
126
+ - AIXM Change Description 3.3-25.: no impact
127
+
128
+ 2003-02-12 3.3 EPR Released version, starting from the previous version
129
+ Changes are:
130
+ - changed version number to 3.3 (synchronised with the entity-relationship model)
131
+ - AIXM Change Descriptions 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78
132
+ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92: no impact
133
+
134
+ 2002-09-16 1.2 EPR Released version, starting from the previous version
135
+ There are no changes in this file.
136
+
137
+ 2002-06-10 1.1 EPR Released version, starting from the previous version
138
+ Changes are:
139
+ - changed version number to 1.1
140
+ - removed the possibility to include more versions of one feature;
141
+ (AIXM-Snapshot is now realy a 'snapshot' at the date and time specified
142
+ in the 'created' attribute of the root element)
143
+ All XxxVersionType complex types have been removed.
144
+ The attribute group Validity has been removed.
145
+ The attribute 'effective' has been added in the AIXM-Update element.
146
+
147
+
148
+ 2002-05-27 1.0 EPR Released version, starting from the previous version.
149
+ Changes are:
150
+ - changed version number to 1.0
151
+ - AIXM Change Description 59: no impact
152
+ - AIXM Change Description 60: no impact
153
+ - AIXM Change Description 61: no impact
154
+ - AIXM Change Description 62: no impact
155
+ - AIXM Change Description 63: no impact
156
+ - AIXM Change Description 64: no impact
157
+ - AIXM Change Description 65: no impact
158
+ - AIXM Change Description 66: no impact
159
+ - AIXM Change Description 67: no impact
160
+
161
+ 2002-03-28 0.9.1 EPR Draft, starting from the previous version.
162
+ Main changes are:
163
+ - inclusion of an annotation containing the version number of the schema
164
+ - inclusion of a 'version' attribute in the <AIXM-Snapshot> element
165
+ - all <AIXM-Snapshot> element attributes have been changed to lower case
166
+ - removed RoutePortionType from the list of child elements of AIXM-Snapshot;
167
+ - AIXM Change Description 57: no impact
168
+ - AIXM Change Description 58: no impact
169
+
170
+
171
+ 2002-03-01 0.9 EPR Draft, completely re-worked, starting from the AIXM Data Model.
172
+ Main changes are:
173
+ - use of data types instead of global elements;
174
+ - use of a new style for data types and element names
175
+ Includes all AIXM Data Model changes up to and including no. 56
176
+
177
+ ************************************************************************************************
178
+ -->
179
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
180
+ <xsd:annotation>
181
+ <xsd:documentation>Version: 4.5-r2</xsd:documentation>
182
+ </xsd:annotation>
183
+ <xsd:include schemaLocation="AIXM-Features.xsd"/>
184
+ <xsd:attributeGroup name="Changes"/>
185
+ <xsd:element name="AIXM-Snapshot">
186
+ <xsd:complexType>
187
+ <xsd:choice maxOccurs="unbounded">
188
+ <xsd:element name="Aas" type="AirspaceAssociationType"/>
189
+ <xsd:element name="Abd" type="AirspaceBorderType"/>
190
+ <xsd:element name="Acr" type="AirspaceCorridorType"/>
191
+ <xsd:element name="Adg" type="AirspaceDerivedGeometryType"/>
192
+ <xsd:element name="Aga" type="GroundServiceAddressType"/>
193
+ <xsd:element name="Agl" type="AeronauticalGroundLightType"/>
194
+ <xsd:element name="Aha" type="AerodromeHeliportAddressType"/>
195
+ <xsd:element name="Ahc" type="AerodromeHeliportCollocationType"/>
196
+ <xsd:element name="Aho" type="AerodromeHeliportObstacleType"/>
197
+ <xsd:element name="Ahp" type="AerodromeHeliportType"/>
198
+ <xsd:element name="Ahs" type="GroundServiceType"/>
199
+ <xsd:element name="Ahu" type="AerodromeHeliportUsageType"/>
200
+ <xsd:element name="Ain" type="NavaidAngularReferenceType"/>
201
+ <xsd:element name="Als" type="ApronLightingSystemType"/>
202
+ <xsd:element name="Ana" type="AerodromeHeliportNavaidType"/>
203
+ <xsd:element name="Apg" type="ApronGeometryType"/>
204
+ <xsd:element name="Apn" type="ApronType"/>
205
+ <xsd:element name="Ase" type="AirspaceType"/>
206
+ <xsd:element name="Din" type="NavaidDistanceIndicationType"/>
207
+ <xsd:element name="Dli" type="DmeUsageLimitationType"/>
208
+ <xsd:element name="Dme" type="DmeType"/>
209
+ <xsd:element name="Dpn" type="DesignatedPointType"/>
210
+ <xsd:element name="Fao" type="FatoOldType">
211
+ <xsd:annotation>
212
+ <xsd:appinfo>DEPRECATED-4.5</xsd:appinfo>
213
+ <xsd:documentation>[Deprecated]</xsd:documentation>
214
+ </xsd:annotation>
215
+ </xsd:element>
216
+ <xsd:element name="Fto" type="FatoType"/>
217
+ <xsd:element name="Fcp" type="FatoCentreLinePositionType"/>
218
+ <xsd:element name="Fda" type="FatoDirectionApproachLightingType"/>
219
+ <xsd:element name="Fdd" type="FatoDirectionDeclaredDistanceType"/>
220
+ <xsd:element name="Fdn" type="FatoDirectionType"/>
221
+ <xsd:element name="Fdo" type="FatoDirectionObstacleType"/>
222
+ <xsd:element name="Fds" type="FatoDirectionStarType"/>
223
+ <xsd:element name="Fls" type="FatoLightingSystemType"/>
224
+ <xsd:element name="Fpa" type="FatoProtectionAreaType"/>
225
+ <xsd:element name="Fpg" type="FatoProtectionAreaGeometryType"/>
226
+ <xsd:element name="Fqy" type="FrequencyType"/>
227
+ <xsd:element name="Ful" type="FuelType"/>
228
+ <xsd:element name="Gbr" type="GeographicalBorderType"/>
229
+ <xsd:element name="Gsd" type="GateStandType"/>
230
+ <xsd:element name="Hpe" type="HoldingProcedureType"/>
231
+ <xsd:element name="Iap" type="InstrumentApproachType"/>
232
+ <xsd:element name="Ils" type="IlsType"/>
233
+ <xsd:element name="Iue" type="InstrumentApproachUsageConditionType"/>
234
+ <xsd:element name="Mgp" type="MsaGroupType"/>
235
+ <xsd:element name="Mkr" type="MkrType"/>
236
+ <xsd:element name="Mls" type="MlsType"/>
237
+ <xsd:element name="Ndb" type="NdbType"/>
238
+ <xsd:element name="Nli" type="NdbUsageLimitationType"/>
239
+ <xsd:element name="Nsc" type="CheckpointType"/>
240
+ <xsd:element name="Ntg" type="NitrogenType"/>
241
+ <xsd:element name="Oaa" type="OrganisationAuthorityAddressType"/>
242
+ <xsd:element name="Oae" type="AirspaceObstacleType"/>
243
+ <xsd:element name="Oas" type="OrganisationAuthorityAssociationType"/>
244
+ <xsd:element name="Obs" type="ObstacleType"/>
245
+ <xsd:element name="Ofa" type="AirspaceAuthorityType"/>
246
+ <xsd:element name="Oil" type="OilType"/>
247
+ <xsd:element name="Org" type="OrganisationAuthorityType"/>
248
+ <xsd:element name="Oxg" type="OxygenType"/>
249
+ <xsd:element name="Pfy" type="PassengerFacilityType"/>
250
+ <xsd:element name="Plb" type="CruisingLevelsTableType"/>
251
+ <xsd:element name="Plc" type="CruisingLevelsColumnType"/>
252
+ <xsd:element name="Rcp" type="RunwayCentreLinePositionType"/>
253
+ <xsd:element name="Rda" type="RunwayDirectionApproachLightingSystemType"/>
254
+ <xsd:element name="Rdd" type="RunwayDirectionDeclaredDistanceType"/>
255
+ <xsd:element name="Rdn" type="RunwayDirectionType"/>
256
+ <xsd:element name="Rdo" type="RunwayDirectionObstacleType"/>
257
+ <xsd:element name="Rds" type="RunwayDirectionStarType"/>
258
+ <xsd:element name="Rls" type="RunwayDirectionLightingSystemType"/>
259
+ <xsd:element name="Rpa" type="RunwayProtectionAreaType"/>
260
+ <xsd:element name="Rpg" type="RunwayProtectionAreaGeometryType"/>
261
+ <xsd:element name="Rsg" type="RouteSegmentType"/>
262
+ <xsd:element name="Rsu" type="RouteSegmentUsageType"/>
263
+ <xsd:element name="Rte" type="EnrouteRouteType"/>
264
+ <xsd:element name="Rwy" type="RunwayType"/>
265
+ <xsd:element name="Sae" type="AirspaceServiceType"/>
266
+ <xsd:element name="Sah" type="AerodromeHeliportServiceType"/>
267
+ <xsd:element name="Ser" type="ServiceType"/>
268
+ <xsd:element name="Shp" type="HoldingProcedureServiceType"/>
269
+ <xsd:element name="Sia" type="StarType"/>
270
+ <xsd:element name="Sid" type="SidType"/>
271
+ <xsd:element name="Sip" type="InstrumentApproachServiceType"/>
272
+ <xsd:element name="Sns" type="SpecialNavigationSystemStationType"/>
273
+ <xsd:element name="Sny" type="SpecialNavigationSystemType"/>
274
+ <xsd:element name="Spa" type="SignificantPointAirspaceType"/>
275
+ <xsd:element name="Spd" type="SpecialDateType"/>
276
+ <xsd:element name="Srs" type="RouteSegmentServiceType"/>
277
+ <xsd:element name="Ssd" type="SidServiceType"/>
278
+ <xsd:element name="Sse" type="StarUsageType"/>
279
+ <xsd:element name="Ssr" type="StarServiceType"/>
280
+ <xsd:element name="Sue" type="SidUsageType"/>
281
+ <xsd:element name="Swy" type="StopwayType"/>
282
+ <xsd:element name="Tcn" type="TacanType"/>
283
+ <xsd:element name="Tcp" type="TaxiwayCentreLinePositionType"/>
284
+ <xsd:element name="Tfr" type="TrafficFlowRestrictionType"/>
285
+ <xsd:element name="Thp" type="TaxiwayHoldingPositionType"/>
286
+ <xsd:element name="Tla" type="TlofType"/>
287
+ <xsd:element name="Tlg" type="TlofGeometryType"/>
288
+ <xsd:element name="Tli" type="TacanUsageLimitationType"/>
289
+ <xsd:element name="Tls" type="TlofLightingSystemType"/>
290
+ <xsd:element name="Tly" type="TaxiwayLightingSystemType"/>
291
+ <xsd:element name="Tsa" type="TlofSafeAreaType"/>
292
+ <xsd:element name="Tsg" type="TlofSafeAreaGeometryType"/>
293
+ <xsd:element name="Twy" type="TaxiwayType"/>
294
+ <xsd:element name="Uac" type="UnitAssociationType"/>
295
+ <xsd:element name="Uas" type="UnitContactAddressType"/>
296
+ <xsd:element name="Uni" type="UnitType"/>
297
+ <xsd:element name="Vli" type="VorUsageLimitationType"/>
298
+ <xsd:element name="Vor" type="VorType"/>
299
+ <xsd:element name="Aac" type="AirspaceAssocType">
300
+ <xsd:annotation>
301
+ <xsd:appinfo>DEPRECATED-4.0</xsd:appinfo>
302
+ <xsd:documentation>[Deprecated]</xsd:documentation>
303
+ </xsd:annotation>
304
+ </xsd:element>
305
+ <xsd:element name="Dln" type="DmeLimitationType">
306
+ <xsd:annotation>
307
+ <xsd:appinfo>DEPRECATED-4.0</xsd:appinfo>
308
+ <xsd:documentation>[Deprecated]</xsd:documentation>
309
+ </xsd:annotation>
310
+ </xsd:element>
311
+ <xsd:element name="Nln" type="NdbLimitationType">
312
+ <xsd:annotation>
313
+ <xsd:appinfo>DEPRECATED-4.0</xsd:appinfo>
314
+ <xsd:documentation>[Deprecated]</xsd:documentation>
315
+ </xsd:annotation>
316
+ </xsd:element>
317
+ <xsd:element name="Tln" type="TacanLimitationType">
318
+ <xsd:annotation>
319
+ <xsd:appinfo>DEPRECATED-4.0</xsd:appinfo>
320
+ <xsd:documentation>[Deprecated]</xsd:documentation>
321
+ </xsd:annotation>
322
+ </xsd:element>
323
+ <xsd:element name="Vln" type="VorLimitationType">
324
+ <xsd:annotation>
325
+ <xsd:appinfo>DEPRECATED-4.0</xsd:appinfo>
326
+ <xsd:documentation>[Deprecated]</xsd:documentation>
327
+ </xsd:annotation>
328
+ </xsd:element>
329
+ </xsd:choice>
330
+ <xsd:attribute name="version" type="xsd:string" use="required">
331
+ <xsd:annotation>
332
+ <xsd:documentation>The version of the AIXM-Snapshot.xsd schema to which the message conforms</xsd:documentation>
333
+ </xsd:annotation>
334
+ </xsd:attribute>
335
+ <xsd:attribute name="origin" type="xsd:string" use="required">
336
+ <xsd:annotation>
337
+ <xsd:documentation>The originator (source) of the message</xsd:documentation>
338
+ </xsd:annotation>
339
+ </xsd:attribute>
340
+ <xsd:attribute name="created" type="xsd:dateTime" use="required">
341
+ <xsd:annotation>
342
+ <xsd:documentation>The date and time when the message was created</xsd:documentation>
343
+ </xsd:annotation>
344
+ </xsd:attribute>
345
+ <xsd:attribute name="effective" type="xsd:dateTime" use="required">
346
+ <xsd:annotation>
347
+ <xsd:documentation>The date and time used as criteria to select valid versions included in the message</xsd:documentation>
348
+ </xsd:annotation>
349
+ </xsd:attribute>
350
+ </xsd:complexType>
351
+ </xsd:element>
352
+ </xsd:schema>
@@ -0,0 +1,3 @@
1
+ module AIXM
2
+ VERSION = "0.1.0".freeze
3
+ end
@@ -0,0 +1,59 @@
1
+ module AIXM
2
+ module Vertical
3
+
4
+ ##
5
+ # Vertical limits
6
+ #
7
+ # Normally noted as:
8
+ #
9
+ # +upper z+ (or +max_z+ whichever is higher)
10
+ # ---------
11
+ # +lower_z+ (or +min_z+ whichever is lower)
12
+ #
13
+ # Use +AIXM::GROUND+ as a shortcut for surface aka zero height.
14
+ class Limits
15
+
16
+ using AIXM::Refinements
17
+
18
+ TAGS = { upper: :Upper, lower: :Lower, max: :Max, min: :Mnm }.freeze
19
+ CODES = { QFE: :HEI, QNH: :ALT, QNE: :STD }.freeze
20
+
21
+ attr_reader :upper_z, :lower_z, :max_z, :min_z
22
+
23
+ ##
24
+ # Defines vertical limits +upper_z+ and +lower_z+
25
+ #
26
+ # Options:
27
+ # * +max_z+ - alternative upper limit "whichever is higher"
28
+ # * +min_z+ - alternative lower limit "whichever is lower"
29
+ def initialize(upper_z:, lower_z:, max_z: nil, min_z: nil)
30
+ fail(ArgumentError, "invalid upper_z") unless upper_z.is_a? AIXM::Z
31
+ fail(ArgumentError, "invalid lower_z") unless lower_z.is_a? AIXM::Z
32
+ fail(ArgumentError, "invalid max_z") unless max_z.nil? || max_z.is_a?(AIXM::Z)
33
+ fail(ArgumentError, "invalid min_z") unless min_z.nil? || min_z.is_a?(AIXM::Z)
34
+ @upper_z, @lower_z, @max_z, @min_z = upper_z, lower_z, max_z, min_z
35
+ end
36
+
37
+ ##
38
+ # Digest to identify the payload
39
+ def to_digest
40
+ [upper_z.alt, upper_z.code, lower_z.alt, lower_z.code, max_z&.alt, max_z&.code, min_z&.alt, min_z&.code].to_digest
41
+ end
42
+
43
+ ##
44
+ # Render AIXM
45
+ #
46
+ # Extensions:
47
+ # * +:OFM+ - Open Flightmaps
48
+ def to_xml(*extensions)
49
+ %i(upper lower max min).each_with_object(Builder::XmlMarkup.new(indent: 2)) do |limit, builder|
50
+ if z = send(:"#{limit}_z")
51
+ builder.tag!(:"codeDistVer#{TAGS[limit]}", CODES[z.code].to_s)
52
+ builder.tag!(:"valDistVer#{TAGS[limit]}", z.alt.to_s)
53
+ builder.tag!(:"uomDistVer#{TAGS[limit]}", z.unit.to_s)
54
+ end
55
+ end.target! # see https://github.com/jimweirich/builder/issues/42
56
+ end
57
+ end
58
+ end
59
+ end
data/lib/aixm/xy.rb ADDED
@@ -0,0 +1,52 @@
1
+ module AIXM
2
+
3
+ ##
4
+ # Geographical coordinates
5
+ #
6
+ # The following notations for longitude and latitude are recognized:
7
+ # * DD - examples: 12.12345678 (north or east), -12.12345678 (south or west)
8
+ # * DMS - examples: 11°22'33.44"N, 1112233.44W
9
+ class XY
10
+
11
+ using AIXM::Refinements
12
+
13
+ def initialize(lat:, long:)
14
+ @lat, @long = float_for(lat), float_for(long)
15
+ fail(ArgumentError, "illegal latitude") unless (-90..90).include? @lat
16
+ fail(ArgumentError, "illegal longitude") unless (-180..180).include? @long
17
+ end
18
+
19
+ def lat(format=nil)
20
+ case format
21
+ when :OFM then ("%.8f" % @lat.abs.round(8)) + (@lat.negative? ? 'S' : 'N')
22
+ when :AIXM then @lat.to_dms(2).gsub(/[^\d.]/, '') + (@lat.negative? ? 'S' : 'N')
23
+ else @lat.round(8)
24
+ end
25
+ end
26
+
27
+ def long(format=nil)
28
+ case format
29
+ when :OFM then ("%.8f" % @long.abs.round(8)) + (@long.negative? ? 'W' : 'E')
30
+ when :AIXM then @long.to_dms(3).gsub(/[^\d.]/, '') + (@long.negative? ? 'W' : 'E')
31
+ else @long.round(8)
32
+ end
33
+ end
34
+
35
+ def ==(other)
36
+ other.is_a?(XY) && lat == other.lat && long == other.long
37
+ end
38
+
39
+ private
40
+
41
+ def float_for(value)
42
+ case value
43
+ when Numeric then value.to_f
44
+ when String then value[0..-2].to_dd * (value =~ /[SW]$/ ? -1 : 1)
45
+ else fail(ArgumentError, "illegal value class `#{value.class}'")
46
+ end
47
+ rescue
48
+ fail(ArgumentError, "illegal value `#{value}'")
49
+ end
50
+
51
+ end
52
+ end