15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/aipp/regions/LF/aip/navigational_aids.rb', line 15
def parse
SOURCE_TYPES.each do |source_type, (primary_type, secondary_type)|
verbose_info("processing #{source_type}")
AIPP.cache.navfix.css(%Q(NavFix[lk^="[LF][#{source_type} "])).each do |navfix_node|
attributes = {
source: source(part: 'ENR', position: navfix_node.line),
organisation: organisation_lf,
id: navfix_node.(:Ident),
xy: xy_from(navfix_node.(:Geometrie))
}
if radionav_node = AIPP.cache.radionav.at_css(%Q(RadioNav:has(NavFix[pk="#{navfix_node.attr(:pk)}"])))
attributes.merge! send(primary_type, radionav_node)
add(
AIXM.send(primary_type, **attributes).tap do |navigational_aid|
navigational_aid.name = radionav_node.(:NomPhraseo) || radionav_node.(:Station)
navigational_aid.timetable = timetable_from(radionav_node.(:HorCode))
navigational_aid. = {
"location/situation" => radionav_node.(:Situation),
"range/portée" => range_from(radionav_node)
}.
navigational_aid.send("associate_#{secondary_type}") if secondary_type
end
)
else
verbose_info("skipping incomplete #{source_type} #{attributes[:id]}")
end
end
end
end
|