Class: ADIWG::Mdtranslator::Writers::Iso19115_2::MD_RangeDimension

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

Instance Method Summary collapse

Constructor Details

#initialize(xml, hResponseObj) ⇒ MD_RangeDimension



18
19
20
21
22
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeDimension.rb', line 18

def initialize(xml, hResponseObj)
   @xml = xml
   @hResponseObj = hResponseObj
   @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
end

Instance Method Details

#writeXML(hAttribute) ⇒ Object



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
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeDimension.rb', line 24

def writeXML(hAttribute)

   # range dimension - sequence identifier {MemberName}
   haveSeqId = false
   haveSeqId = true unless hAttribute[:sequenceIdentifier].nil?
   haveSeqId = true unless hAttribute[:sequenceIdentifierType].nil?
   if haveSeqId
      @xml.tag!('gmd:sequenceIdentifier') do
         @xml.tag!('gco:MemberName') do

            unless hAttribute[:sequenceIdentifier].nil?
               @xml.tag!('gco:aName') do
                  @xml.tag!('gco:CharacterString', hAttribute[:sequenceIdentifier])
               end
            end
            if hAttribute[:sequenceIdentifier].nil?
               @NameSpace.issueWarning(350, 'gco:aName', 'coverage description attribute')
            end

            unless hAttribute[:sequenceIdentifierType].nil?
               @xml.tag!('gco:attributeType') do
                  @xml.tag!('gco:TypeName') do
                     @xml.tag!('gco:aName') do
                        @xml.tag!('gco:CharacterString', hAttribute[:sequenceIdentifierType])
                     end
                  end
               end
            end
            if hAttribute[:sequenceIdentifierType].nil?
               @NameSpace.issueWarning(351, 'gco:aName', 'coverage description attribute')
            end
         end
      end
   end
   if !haveSeqId && @hResponseObj[:writerShowTags]
      @xml.tag!('gmd:sequenceIdentifier')
   end

   # range dimension - descriptor
   unless hAttribute[:attributeDescription].nil?
      @xml.tag!('gmd:descriptor') do
         @xml.tag!('gco:CharacterString', hAttribute[:attributeDescription])
      end
   end
   if hAttribute[:attributeDescription].nil? && @hResponseObj[:writerShowTags]
      @xml.tag!('gmd:descriptor')
   end

end