aixm 0.3.7 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +72 -6
  4. data/README.md +191 -53
  5. data/exe/ckmid +11 -0
  6. data/exe/mkmid +11 -0
  7. data/lib/aixm/association.rb +367 -0
  8. data/lib/aixm/classes.rb +44 -0
  9. data/lib/aixm/component/fato.rb +44 -52
  10. data/lib/aixm/component/frequency.rb +13 -14
  11. data/lib/aixm/component/geometry/arc.rb +2 -2
  12. data/lib/aixm/component/geometry/border.rb +14 -5
  13. data/lib/aixm/component/geometry/circle.rb +8 -2
  14. data/lib/aixm/component/geometry/point.rb +10 -3
  15. data/lib/aixm/component/geometry/rhumb_line.rb +54 -0
  16. data/lib/aixm/component/geometry.rb +38 -38
  17. data/lib/aixm/component/helipad.rb +29 -37
  18. data/lib/aixm/component/layer.rb +28 -19
  19. data/lib/aixm/component/lighting.rb +11 -12
  20. data/lib/aixm/component/runway.rb +46 -53
  21. data/lib/aixm/{feature → component}/service.rb +36 -35
  22. data/lib/aixm/component/surface.rb +3 -3
  23. data/lib/aixm/component/timetable.rb +5 -3
  24. data/lib/aixm/component/{vertical_limits.rb → vertical_limit.rb} +12 -6
  25. data/lib/aixm/config.rb +6 -3
  26. data/lib/aixm/document.rb +31 -49
  27. data/lib/aixm/executables.rb +85 -0
  28. data/lib/aixm/f.rb +28 -0
  29. data/lib/aixm/feature/address.rb +20 -15
  30. data/lib/aixm/feature/airport.rb +113 -129
  31. data/lib/aixm/feature/airspace.rb +54 -23
  32. data/lib/aixm/feature/navigational_aid/designated_point.rb +12 -14
  33. data/lib/aixm/feature/navigational_aid/dme.rb +10 -11
  34. data/lib/aixm/feature/navigational_aid/marker.rb +6 -2
  35. data/lib/aixm/feature/navigational_aid/ndb.rb +6 -2
  36. data/lib/aixm/feature/navigational_aid/tacan.rb +6 -2
  37. data/lib/aixm/feature/navigational_aid/vor.rb +22 -14
  38. data/lib/aixm/feature/navigational_aid.rb +7 -9
  39. data/lib/aixm/feature/obstacle.rb +22 -20
  40. data/lib/aixm/feature/obstacle_group.rb +30 -30
  41. data/lib/aixm/feature/organisation.rb +20 -4
  42. data/lib/aixm/feature/unit.rb +35 -45
  43. data/lib/aixm/feature.rb +13 -3
  44. data/lib/aixm/memoize.rb +89 -0
  45. data/lib/aixm/object.rb +9 -0
  46. data/lib/aixm/payload_hash.rb +114 -0
  47. data/lib/aixm/refinements.rb +34 -50
  48. data/lib/aixm/shortcuts.rb +6 -43
  49. data/lib/aixm/version.rb +1 -1
  50. data/lib/aixm/xy.rb +9 -1
  51. data/lib/aixm.rb +18 -7
  52. data/schemas/ofmx/{0 → 0.1}/OFMX-CSV-Obstacle.json +0 -0
  53. data/schemas/ofmx/{0 → 0.1}/OFMX-CSV.json +0 -0
  54. data/schemas/ofmx/{0 → 0.1}/OFMX-DataTypes.xsd +52 -2
  55. data/schemas/ofmx/{0 → 0.1}/OFMX-Features.xsd +225 -14
  56. data/schemas/ofmx/{0 → 0.1}/OFMX-Snapshot.xsd +0 -5
  57. data.tar.gz.sig +0 -0
  58. metadata +116 -164
  59. metadata.gz.sig +0 -0
  60. data/.gitignore +0 -6
  61. data/.ruby-version +0 -1
  62. data/.travis.yml +0 -8
  63. data/.yardopts +0 -3
  64. data/Guardfile +0 -8
  65. data/aixm.gemspec +0 -35
  66. data/gems.rb +0 -3
  67. data/lib/aixm/component.rb +0 -6
  68. data/rakefile.rb +0 -22
  69. data/spec/factory.rb +0 -559
  70. data/spec/lib/aixm/a_spec.rb +0 -203
  71. data/spec/lib/aixm/component/fato_spec.rb +0 -260
  72. data/spec/lib/aixm/component/frequency_spec.rb +0 -75
  73. data/spec/lib/aixm/component/geometry/arc_spec.rb +0 -75
  74. data/spec/lib/aixm/component/geometry/border_spec.rb +0 -33
  75. data/spec/lib/aixm/component/geometry/circle_spec.rb +0 -70
  76. data/spec/lib/aixm/component/geometry/point_spec.rb +0 -39
  77. data/spec/lib/aixm/component/geometry_spec.rb +0 -321
  78. data/spec/lib/aixm/component/helipad_spec.rb +0 -187
  79. data/spec/lib/aixm/component/layer_spec.rb +0 -137
  80. data/spec/lib/aixm/component/lighting_spec.rb +0 -88
  81. data/spec/lib/aixm/component/runway_spec.rb +0 -472
  82. data/spec/lib/aixm/component/surface_spec.rb +0 -124
  83. data/spec/lib/aixm/component/timetable_spec.rb +0 -49
  84. data/spec/lib/aixm/component/vertical_limits_spec.rb +0 -97
  85. data/spec/lib/aixm/config_spec.rb +0 -41
  86. data/spec/lib/aixm/d_spec.rb +0 -150
  87. data/spec/lib/aixm/document_spec.rb +0 -1875
  88. data/spec/lib/aixm/errors_spec.rb +0 -14
  89. data/spec/lib/aixm/f_spec.rb +0 -85
  90. data/spec/lib/aixm/feature/address_spec.rb +0 -55
  91. data/spec/lib/aixm/feature/airport_spec.rb +0 -770
  92. data/spec/lib/aixm/feature/airspace_spec.rb +0 -390
  93. data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +0 -98
  94. data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +0 -92
  95. data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +0 -79
  96. data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +0 -89
  97. data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +0 -88
  98. data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +0 -245
  99. data/spec/lib/aixm/feature/navigational_aid_spec.rb +0 -52
  100. data/spec/lib/aixm/feature/obstacle_group_spec.rb +0 -326
  101. data/spec/lib/aixm/feature/obstacle_spec.rb +0 -279
  102. data/spec/lib/aixm/feature/organisation_spec.rb +0 -77
  103. data/spec/lib/aixm/feature/service_spec.rb +0 -59
  104. data/spec/lib/aixm/feature/unit_spec.rb +0 -230
  105. data/spec/lib/aixm/feature_spec.rb +0 -38
  106. data/spec/lib/aixm/p_spec.rb +0 -189
  107. data/spec/lib/aixm/refinements_spec.rb +0 -381
  108. data/spec/lib/aixm/version_spec.rb +0 -7
  109. data/spec/lib/aixm/w_spec.rb +0 -150
  110. data/spec/lib/aixm/xy_spec.rb +0 -180
  111. data/spec/lib/aixm/z_spec.rb +0 -94
  112. data/spec/macros/marking.rb +0 -12
  113. data/spec/macros/organisation.rb +0 -11
  114. data/spec/macros/remarks.rb +0 -12
  115. data/spec/macros/timetable.rb +0 -11
  116. data/spec/macros/xy.rb +0 -11
  117. data/spec/macros/z_qnh.rb +0 -11
  118. data/spec/sounds/failure.mp3 +0 -0
  119. data/spec/sounds/success.mp3 +0 -0
  120. data/spec/spec_helper.rb +0 -55
@@ -1,48 +1,11 @@
1
- module AIXM
1
+ using AIXM::Refinements
2
2
 
3
- # List of shorthand names and their corresponding AIXM classes
4
- CLASSES = {
5
- document: Document,
6
- xy: XY,
7
- z: Z,
8
- d: D,
9
- f: F,
10
- a: A,
11
- w: W,
12
- p: P,
13
- address: Feature::Address,
14
- organisation: Feature::Organisation,
15
- unit: Feature::Unit,
16
- service: Feature::Service,
17
- frequency: Component::Frequency,
18
- airport: Feature::Airport,
19
- runway: Component::Runway,
20
- fato: Component::FATO,
21
- helipad: Component::Helipad,
22
- surface: Component::Surface,
23
- lighting: Component::Lighting,
24
- airspace: Feature::Airspace,
25
- layer: Component::Layer,
26
- geometry: Component::Geometry,
27
- vertical_limits: Component::VerticalLimits,
28
- arc: Component::Geometry::Arc,
29
- border: Component::Geometry::Border,
30
- circle: Component::Geometry::Circle,
31
- point: Component::Geometry::Point,
32
- dme: Feature::NavigationalAid::DME,
33
- designated_point: Feature::NavigationalAid::DesignatedPoint,
34
- marker: Feature::NavigationalAid::Marker,
35
- tacan: Feature::NavigationalAid::TACAN,
36
- ndb: Feature::NavigationalAid::NDB,
37
- vor: Feature::NavigationalAid::VOR,
38
- obstacle: Feature::Obstacle,
39
- obstacle_group: Feature::ObstacleGroup,
40
- timetable: Component::Timetable
41
- }.freeze
3
+ module AIXM
42
4
 
43
- CLASSES.each do |element, klass|
44
- define_singleton_method(element) do |*arguments|
45
- klass.new(*arguments)
5
+ # Shortcut initializers
6
+ CLASSES.each do |element, class_name|
7
+ define_singleton_method(element) do |*args, **kwargs|
8
+ class_name.to_class.new(*args, **kwargs)
46
9
  end
47
10
  end
48
11
 
data/lib/aixm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module AIXM
2
- VERSION = "0.3.7".freeze
2
+ VERSION = "1.0.0".freeze
3
3
  end
data/lib/aixm/xy.rb CHANGED
@@ -4,6 +4,14 @@ module AIXM
4
4
 
5
5
  # Geographical coordinates
6
6
  #
7
+ # ===Warning!
8
+ # Coordinate tuples can be noted in mathematical order (XY = longitude first,
9
+ # latitude second) or in (more common) geographical order (YX = latitude
10
+ # first, longitude second). However you sort the attributes, make sure not
11
+ # to flip them by accident.
12
+ #
13
+ # See https://en.wikipedia.org/wiki/Geographic_coordinate_system
14
+ #
7
15
  # ===Recognized notations:
8
16
  # * DD - examples: 12.12345678 (north or east), -12.12345678 (south or west)
9
17
  # * DMS - examples: 11°22'33.44"N, 1112233.44W,
@@ -19,7 +27,7 @@ module AIXM
19
27
  # * +AIXM::SEC+ - characters recognized as DMS second symbols
20
28
  # * +AIXM::DMS_RE+ - regular expression to match DMS coordinate notations
21
29
  #
22
- # @see https://github.com/openflightmaps/ofmx/wiki/Coordinates
30
+ # @see https://gitlab.com/openflightmaps/ofmx/wikis/Coordinates
23
31
  class XY
24
32
  EARTH_RADIUS = 6_371_008.8
25
33
 
data/lib/aixm.rb CHANGED
@@ -1,18 +1,28 @@
1
- require 'builder'
2
1
  require 'ostruct'
3
2
  require 'securerandom'
4
- require 'nokogiri'
5
3
  require 'forwardable'
6
4
  require 'digest'
7
5
  require 'time'
8
6
  require 'pathname'
7
+ require 'optparse'
8
+
9
+ require 'builder'
10
+ require 'nokogiri'
11
+ require 'dry/inflector'
12
+
13
+ require_relative 'aixm/object'
9
14
 
10
15
  require_relative 'aixm/version'
11
- require_relative 'aixm/constants'
12
16
  require_relative 'aixm/refinements'
13
17
  require_relative 'aixm/config'
14
18
  require_relative 'aixm/errors'
15
19
 
20
+ require_relative 'aixm/classes'
21
+ require_relative 'aixm/constants'
22
+ require_relative 'aixm/memoize'
23
+ require_relative 'aixm/association'
24
+ require_relative 'aixm/payload_hash'
25
+
16
26
  require_relative 'aixm/document'
17
27
  require_relative 'aixm/xy'
18
28
  require_relative 'aixm/z'
@@ -22,15 +32,16 @@ require_relative 'aixm/a'
22
32
  require_relative 'aixm/w'
23
33
  require_relative 'aixm/p'
24
34
 
25
- require_relative 'aixm/component'
35
+ require_relative 'aixm/component/service'
26
36
  require_relative 'aixm/component/frequency'
27
37
  require_relative 'aixm/component/geometry'
28
38
  require_relative 'aixm/component/geometry/point'
39
+ require_relative 'aixm/component/geometry/rhumb_line'
29
40
  require_relative 'aixm/component/geometry/arc'
30
- require_relative 'aixm/component/geometry/border'
31
41
  require_relative 'aixm/component/geometry/circle'
42
+ require_relative 'aixm/component/geometry/border'
32
43
  require_relative 'aixm/component/layer'
33
- require_relative 'aixm/component/vertical_limits'
44
+ require_relative 'aixm/component/vertical_limit'
34
45
  require_relative 'aixm/component/timetable'
35
46
  require_relative 'aixm/component/runway'
36
47
  require_relative 'aixm/component/fato'
@@ -42,7 +53,6 @@ require_relative 'aixm/feature'
42
53
  require_relative 'aixm/feature/address'
43
54
  require_relative 'aixm/feature/organisation'
44
55
  require_relative 'aixm/feature/unit'
45
- require_relative 'aixm/feature/service'
46
56
  require_relative 'aixm/feature/airspace'
47
57
  require_relative 'aixm/feature/airport'
48
58
  require_relative 'aixm/feature/navigational_aid'
@@ -56,3 +66,4 @@ require_relative 'aixm/feature/obstacle'
56
66
  require_relative 'aixm/feature/obstacle_group'
57
67
 
58
68
  require_relative 'aixm/shortcuts'
69
+ require_relative 'aixm/executables'
File without changes
File without changes
@@ -1900,7 +1900,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1900
1900
  <xsd:simpleType name="codeIdDesigPtBase">
1901
1901
  <xsd:restriction base="alphanumeric">
1902
1902
  <xsd:minLength value="1"/>
1903
- <xsd:maxLength value="5"/>
1903
+ <xsd:maxLength value="10"/>
1904
1904
  </xsd:restriction>
1905
1905
  </xsd:simpleType>
1906
1906
  <xsd:complexType name="codeIdDesigPt">
@@ -3403,7 +3403,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3403
3403
  <xsd:enumeration value="VFR-RP"/>
3404
3404
  <xsd:enumeration value="VFR-MRP"/>
3405
3405
  <xsd:enumeration value="VFR-ENR"/>
3406
- <xsd:enumeration value="VFR-GLD"/>
3406
+ <xsd:enumeration value="VFR-GLDR"/>
3407
+ <xsd:enumeration value="VFR-HELI"/>
3408
+ <xsd:enumeration value="TOWN"/>
3409
+ <xsd:enumeration value="MOUNTAIN-TOP"/>
3410
+ <xsd:enumeration value="MOUNTAIN-PASS"/>
3407
3411
  <xsd:enumeration value="OTHER"/>
3408
3412
  </xsd:restriction>
3409
3413
  </xsd:simpleType>
@@ -4436,6 +4440,22 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4436
4440
  </xsd:extension>
4437
4441
  </xsd:simpleContent>
4438
4442
  </xsd:complexType>
4443
+ <xsd:simpleType name="codeCodingModeBase">
4444
+ <xsd:restriction base="xsd:string">
4445
+ <xsd:enumeration value="CONST"/>
4446
+ <xsd:enumeration value="PARA"/>
4447
+ </xsd:restriction>
4448
+ </xsd:simpleType>
4449
+ <xsd:complexType name="codeCodingMode">
4450
+ <xsd:annotation>
4451
+ <xsd:documentation>A code for coding mode: Constant or Parametrized.</xsd:documentation>
4452
+ </xsd:annotation>
4453
+ <xsd:simpleContent>
4454
+ <xsd:extension base="codeCodingModeBase">
4455
+ <xsd:attributeGroup ref="Changes"/>
4456
+ </xsd:extension>
4457
+ </xsd:simpleContent>
4458
+ </xsd:complexType>
4439
4459
  <xsd:simpleType name="dateMonthDayBase">
4440
4460
  <xsd:restriction base="xsd:string">
4441
4461
  <xsd:pattern value="(((0[1-9])|(1[0-9])|(2[0-9]))\-((0[1-9])|10|11|12))|(30\-(01|03|04|05|06|07|08|09|10|11|12))|(31\-(01|03|05|07|08|10|12))|SDLST|EDLST"/>
@@ -4496,6 +4516,36 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4496
4516
  </xsd:extension>
4497
4517
  </xsd:simpleContent>
4498
4518
  </xsd:complexType>
4519
+ <xsd:simpleType name="lineBase">
4520
+ <xsd:restriction base="xsd:string">
4521
+ <xsd:pattern value="-?((0\d|1[0-7])\d\.\d{8}|180\.0{8}),-?([0-8]\d\.\d{8}|90\.0{8})( -?((0\d|1[0-7])\d\.\d{8}|180\.0{8}),-?([0-8]\d\.\d{8}|90\.0{8}))+"/>
4522
+ </xsd:restriction>
4523
+ </xsd:simpleType>
4524
+ <xsd:complexType name="line">
4525
+ <xsd:annotation>
4526
+ <xsd:documentation>A line or polygon.</xsd:documentation>
4527
+ </xsd:annotation>
4528
+ <xsd:simpleContent>
4529
+ <xsd:extension base="lineBase">
4530
+ <xsd:attributeGroup ref="Changes"/>
4531
+ </xsd:extension>
4532
+ </xsd:simpleContent>
4533
+ </xsd:complexType>
4534
+ <xsd:simpleType name="bezierCurveBase">
4535
+ <xsd:restriction base="xsd:string">
4536
+ <xsd:pattern value="-?((0\d|1[0-7])\d\.\d{8}|180\.0{8}),-?([0-8]\d\.\d{8}|90\.0{8})(( -?((0\d|1[0-7])\d\.\d{8}|180\.0{8}),-?([0-8]\d\.\d{8}|90\.0{8})){3})+"/>
4537
+ </xsd:restriction>
4538
+ </xsd:simpleType>
4539
+ <xsd:complexType name="bezierCurve">
4540
+ <xsd:annotation>
4541
+ <xsd:documentation>An open or closed Bézier curve.</xsd:documentation>
4542
+ </xsd:annotation>
4543
+ <xsd:simpleContent>
4544
+ <xsd:extension base="bezierCurveBase">
4545
+ <xsd:attributeGroup ref="Changes"/>
4546
+ </xsd:extension>
4547
+ </xsd:simpleContent>
4548
+ </xsd:complexType>
4499
4549
  <xsd:simpleType name="noNumberBase">
4500
4550
  <xsd:restriction base="xsd:decimal">
4501
4551
  <xsd:pattern value="\d{1,4}"/>