aipp 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26ef796dce1fa17d820789dde8827d9eb9e2a65a08c8f3188f7f77817831705e
4
- data.tar.gz: 42d29d718c93d348e1a316f68030ee668f385ea7e0777b4237686c343fe14da0
3
+ metadata.gz: fb12aa39a6f3fdec1fd5aad06f710f6e87a0898c7b438306e08dc5a7b663a96e
4
+ data.tar.gz: af5e924c030036416ed373ae2196975ef1ddcf564ded3eca39f60d2c5d99cd23
5
5
  SHA512:
6
- metadata.gz: 2485bf5b7e124649f3286e8fdacb3086b559d8178ff1d7b6b5610973be1c6c64ac78998c786e59b847fc3224478bdb51363dcc917b8ddf9b449f8059142b2b68
7
- data.tar.gz: 2af199441c341c7984e500ff517438877bdf3364243e85df99f0d3f7be6476179f023604cb0af466a16f09cd1becdd067b7e87688a6a366a03215480edd48435
6
+ metadata.gz: ab37e2bfcdb4a6419450c8a75c2bd1d3a6dbcdf2b4f2e9f86d5859a4d41e5bc6fc30bcaf629c82e61e98613641477d922743d3d3776b205ab2b255eaae081c1a
7
+ data.tar.gz: 6fdf209fed20da43f36b9f62cbae84be1c939bd839c87db1ff432ac751085d06f281a4607fd6531abd84c8ba46beebe0271d9527461d761c16508e92ddc9fbea
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  Nothing so far
4
4
 
5
+ ## 2.2.1
6
+
7
+ #### Changes
8
+ * Adopt latest update of OFMX to accommodate new airspace types RMZ, TMZ and DRA
9
+
5
10
  ## 2.2.0
6
11
 
7
12
  #### Changes
@@ -3,6 +3,8 @@ module AIPP::LF::AIP
3
3
 
4
4
  include AIPP::LF::Helpers::Base
5
5
 
6
+ depends_on :Aerodromes
7
+
6
8
  # Map source types to type and optional local type and skip regexp
7
9
  SOURCE_TYPES = {
8
10
  'FIR' => { type: 'FIR' },
@@ -13,9 +15,7 @@ module AIPP::LF::AIP
13
15
  'TMA' => { type: 'TMA', skip: /geneve/i }, # Geneva listed FYI only
14
16
  'SIV' => { type: 'SECTOR', local_type: 'FIZ/SIV' }, # providing FIS
15
17
  'CTR' => { type: 'CTR' },
16
- 'RMZ' => { type: 'RAS', local_type: 'RMZ' },
17
- 'TMZ' => { type: 'RAS', local_type: 'TMZ' },
18
- 'RMZ-TMZ' => { type: 'RAS', local_type: 'RMZ-TMZ' }
18
+ 'RMZ-TMZ' => { type: ['RMZ', 'TMZ'] } # two separate airspaces
19
19
  }.freeze
20
20
 
21
21
  # Map airspace "<type> <name>" to location indicator
@@ -36,34 +36,57 @@ module AIPP::LF::AIP
36
36
  next if espace_node.(:Nom).match? DELEGATED_RE
37
37
  next if (re = target[:skip]) && espace_node.(:Nom).match?(re)
38
38
  # Build airspaces and layers
39
- AIPP.cache.partie.css(%Q(Partie:has(Espace[pk="#{espace_node['pk']}"]))).each do |partie_node|
39
+ partie_nodes = AIPP.cache.partie.css(%Q(Partie:has(Espace[pk="#{espace_node['pk']}"])))
40
+ partie_nodes.each_with_index do |partie_node, index|
40
41
  next if partie_node.(:NomPartie).match? DELEGATED_RE
41
- add(
42
- AIXM.airspace(
43
- source: source(part: 'ENR', position: espace_node.line),
44
- name: [
45
- espace_node.(:Nom),
46
- partie_node.(:NomPartie).remove(/^\.$/).blank_to_nil
47
- ].compact.join(' '),
48
- type: target[:type],
49
- local_type: target[:local_type]
50
- ).tap do |airspace|
51
- airspace.meta = espace_node.attr('pk')
52
- airspace.geometry = geometry_from(partie_node.(:Contour))
53
- fail("geometry is not closed") unless airspace.geometry.closed?
54
- AIPP.cache.volume.css(%Q(Volume:has(Partie[pk="#{partie_node['pk']}"]))).each do |volume_node|
55
- airspace.add_layer(
56
- layer_from(volume_node).tap do |layer|
57
- layer.location_indicator = FIR_LOCATION_INDICATORS.fetch(airspace.name) if airspace.type == :flight_information_region
58
- end
59
- )
60
- end
42
+ partie_nom = partie_node.(:NomPartie).remove(/^\.$/).blank_to_nil
43
+ partie_index = if partie_nodes.count > 1
44
+ if partie_nom.match?(/^\d+$/)
45
+ partie_nom.to_i # use declared index if numerical...
46
+ else
47
+ index # ...or positional index otherwise
61
48
  end
62
- )
49
+ end
50
+ [target[:type]].flatten.each do |type|
51
+ add(
52
+ AIXM.airspace(
53
+ source: source(part: 'ENR', position: espace_node.line),
54
+ id: id_from(espace_node, partie_index),
55
+ name: name_from(espace_node, partie_nom),
56
+ type: type,
57
+ local_type: target[:local_type]
58
+ ).tap do |airspace|
59
+ airspace.meta = espace_node.attr('pk')
60
+ airspace.geometry = geometry_from(partie_node.(:Contour))
61
+ fail("geometry is not closed") unless airspace.geometry.closed?
62
+ AIPP.cache.volume.css(%Q(Volume:has(Partie[pk="#{partie_node['pk']}"]))).each do |volume_node|
63
+ airspace.add_layer(
64
+ layer_from(volume_node).tap do |layer|
65
+ layer.location_indicator = FIR_LOCATION_INDICATORS.fetch(airspace.name) if airspace.type == :flight_information_region
66
+ end
67
+ )
68
+ end
69
+ end
70
+ )
71
+ end
63
72
  end
64
73
  end
65
74
  end
66
75
  end
67
76
 
77
+ private
78
+
79
+ def id_from(espace_node, partie_index)
80
+ if espace_node.(:TypeEspace) == 'CTR' &&
81
+ (ad_pk = espace_node.at_css(:AdAssocie)&.attr('pk')) &&
82
+ (airport = find_by(:airport, meta: ad_pk).first)
83
+ then
84
+ [airport.id, partie_index].join
85
+ end
86
+ end
87
+
88
+ def name_from(espace_node, partie_nom)
89
+ [espace_node.(:Nom), partie_nom].compact.join(' ')
90
+ end
68
91
  end
69
92
  end
@@ -40,10 +40,16 @@ module AIPP::LF::AIP
40
40
  AIPP.cache.service.css(%Q(Service[lk^="[LF]"][pk])).each do |service_node|
41
41
  # Ignore private services/frequencies
42
42
  next if service_node.(:IndicLieu) == 'XX'
43
- # Load referenced airport
43
+ # Load directly referenced airport
44
44
  airport = given(service_node.at_css('Ad')&.attr('pk')) do
45
45
  find_by(:airport, meta: _1).first
46
46
  end
47
+ # Load indirectly referenced airport
48
+ airport ||= given(service_node.at_css('Espace')&.attr('pk')) do
49
+ if airspace = find_by(:airspace, meta: _1)&.first
50
+ find_by(:airport, id: airspace.id[0, 4])&.first
51
+ end
52
+ end
47
53
  # Build addresses and services
48
54
  case SOURCE_TYPES.fetch(type_for(service_node))
49
55
  when :address
@@ -53,7 +59,9 @@ module AIPP::LF::AIP
53
59
  given service_from(service_node) do |service|
54
60
  AIPP.cache.frequence.css(%Q(Frequence:has(Service[pk="#{service_node['pk']}"]))).each do |frequence_node|
55
61
  if frequency = frequency_from(frequence_node, service_node)
56
- service.add_frequency frequency
62
+ unless frequency.type == :emergency
63
+ service.add_frequency frequency
64
+ end
57
65
  end
58
66
  end
59
67
  if airport
@@ -70,7 +78,10 @@ module AIPP::LF::AIP
70
78
  end
71
79
  # Assign A/A address to all yet radioless airports
72
80
  find_by(:airport).each do |airport|
73
- unless airport.services.find_by(:service, type: :aerodrome_control_tower_service).any? || airport.addresses.any?
81
+ unless airport.addresses.any? ||
82
+ airport.services.find_by(:service, type: :aerodrome_control_tower_service).any? ||
83
+ airport.services.find_by(:service, type: :flight_information_service).any?
84
+ then
74
85
  airport.add_address(
75
86
  address_from_vac_for(airport) || fallback_address_for(airport)
76
87
  )
data/lib/aipp/runner.rb CHANGED
@@ -115,7 +115,11 @@ module AIPP
115
115
  info("detecting duplicates")
116
116
  if (duplicates = aixm.features.duplicates).any?
117
117
  message = "duplicates found"
118
- details = duplicates.map { "#{_1.inspect} from #{_1.source}" }.join("\n")
118
+ details = duplicates.map do |group|
119
+ group.map.with_index do |member, index|
120
+ "#{member.inspect} from #{member.source} #{'has duplicate(s)...' if index.zero?}"
121
+ end
122
+ end.join("\n")
119
123
  AIPP.options.force ? warn(message) : fail([message, details].join(":\n"))
120
124
  end
121
125
  info("validating #{AIPP.options.schema.upcase}")
data/lib/aipp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module AIPP
2
- VERSION = "2.2.0".freeze
2
+ VERSION = "2.2.1".freeze
3
3
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aipp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
@@ -27,7 +27,7 @@ cert_chain:
27
27
  k/QvZU05f6HMYBrPogJgIzHC/C5N/yeE4BVEuBDn+10Zb1iu3aDk8sd0uMgukCY8
28
28
  TUmlP5A6NeGdeDJIoLgromAKs+nvI7TWzhQq9ODs51XhxgUFRCvBqUTpjTQigw==
29
29
  -----END CERTIFICATE-----
30
- date: 2024-04-04 00:00:00.000000000 Z
30
+ date: 2024-05-29 00:00:00.000000000 Z
31
31
  dependencies:
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: airac
@@ -58,7 +58,7 @@ dependencies:
58
58
  version: '1'
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.5.0
61
+ version: 1.5.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
@@ -68,7 +68,7 @@ dependencies:
68
68
  version: '1'
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
- version: 1.5.0
71
+ version: 1.5.2
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: notam
74
74
  requirement: !ruby/object:Gem::Requirement
@@ -474,7 +474,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
474
474
  - !ruby/object:Gem::Version
475
475
  version: '0'
476
476
  requirements: []
477
- rubygems_version: 3.5.7
477
+ rubygems_version: 3.5.11
478
478
  signing_key:
479
479
  specification_version: 4
480
480
  summary: Parser for aeronautical information publications
metadata.gz.sig CHANGED
Binary file