Module: ADIWG::Mdtranslator::Readers::MdJson::LocalProjection

Defined in:
lib/adiwg/mdtranslator/readers/mdJson/modules/module_localProjection.rb

Class Method Summary collapse

Class Method Details

.unpack(hLocal, responseObj, inContext = nil) ⇒ Object



14
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
44
45
46
47
48
49
50
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_localProjection.rb', line 14

def self.unpack(hLocal, responseObj, inContext = nil)

   @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson

   # return nil object if input is empty
   if hLocal.empty?
      @MessagePath.issueWarning(950, responseObj, inContext)
      return nil
   end

   # instance classes needed in script
   intMetadataClass = .new
   intLocal = intMetadataClass.newLocal

   # local projection - fixed to earth (required) {boolean default = true}
   if hLocal.has_key?('fixedToEarth')
      if hLocal['fixedToEarth'] === false
         intLocal[:fixedToEarth] = false
      end
   end

   # local projection - description
   if hLocal.has_key?('description')
      unless hLocal['description'] == ''
         intLocal[:description] = hLocal['description']
      end
   end

   # local projection - georeference
   if hLocal.has_key?('georeference')
      unless hLocal['georeference'] == ''
         intLocal[:georeference] = hLocal['georeference']
      end
   end

   return intLocal
end