Class: ADIWG::Mdtranslator::Writers::Iso19115_2::MD_Band

Inherits:
Object
  • Object
show all
Defined in:
lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml, hResponseObj) ⇒ MD_Band



17
18
19
20
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb', line 17

def initialize(xml, hResponseObj)
   @xml = xml
   @hResponseObj = hResponseObj
end

Instance Method Details

#writeXML(hAttribute) ⇒ Object



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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb', line 22

def writeXML(hAttribute)

   # classes used
   uomClass = UnitsOfMeasure.new(@xml, @hResponseObj)

   # mdBand - max value
   s = hAttribute[:maxValue]
   unless s.nil?
      @xml.tag!('gmd:maxValue') do
         @xml.tag!('gco:Real', s)
      end
   end
   if s.nil? && @hResponseObj[:writerShowTags]
      @xml.tag!('gmd:maxValue')
   end

   # mdBand - min value
   s = hAttribute[:minValue]
   unless s.nil?
      @xml.tag!('gmd:minValue') do
         @xml.tag!('gco:Real', s)
      end
   end
   if s.nil? && @hResponseObj[:writerShowTags]
      @xml.tag!('gmd:minValue')
   end

   # mdBand - units
   s = hAttribute[:units]
   unless s.nil?
      @xml.tag!('gmd:units') do
         uomClass.writeUnits(s)
      end
   end
   if s.nil? && @hResponseObj[:writerShowTags]
      @xml.tag!('gmd:units')
   end

   # mdBand - peak response
   s = hAttribute[:peakResponse]
   unless s.nil?
      @xml.tag!('gmd:peakResponse') do
         @xml.tag!('gco:Real', s)
      end
   end
   if s.nil? && @hResponseObj[:writerShowTags]
      @xml.tag!('gmd:peakResponse')
   end

   # mdBand - bits per value
   s = hAttribute[:bitsPerValue]
   unless s.nil?
      @xml.tag!('gmd:bitsPerValue') do
         @xml.tag!('gco:Integer', s)
      end
   end
   if s.nil? && @hResponseObj[:writerShowTags]
      @xml.tag!('gmd:bitsPerValue')
   end

   # mdBand - tone gradation
   s = hAttribute[:toneGradations]
   unless s.nil?
      @xml.tag!('gmd:toneGradation') do
         @xml.tag!('gco:Integer', s)
      end
   end
   if s.nil? && @hResponseObj[:writerShowTags]
      @xml.tag!('gmd:toneGradation')
   end

   # mdBand - scale factor
   s = hAttribute[:scaleFactor]
   unless s.nil?
      @xml.tag!('gmd:scaleFactor') do
         @xml.tag!('gco:Real', s)
      end
   end
   if s.nil? && @hResponseObj[:writerShowTags]
      @xml.tag!('gmd:scaleFactor')
   end

   # mdBand - offset
   s = hAttribute[:offset]
   unless s.nil?
      @xml.tag!('gmd:offset') do
         @xml.tag!('gco:Real', s)
      end
   end
   if s.nil? && @hResponseObj[:writerShowTags]
      @xml.tag!('gmd:offset')
   end

end