Sha256: ee5deb9c1829dfb06fe81f3f1fb732133317bb082d6bf19770fff48e785f8cd5

Contents?: true

Size: 1.94 KB

Versions: 27

Compression:

Stored size: 1.94 KB

Contents

# ISO <<Class>> LE_Algorithm
# 19115-2 writer output in XML

# History:
# 	Stan Smith 201-09-25 original script.

require_relative '../iso19115_2_writer'
require_relative 'class_citation'

module ADIWG
   module Mdtranslator
      module Writers
         module Iso19115_2

            class LE_Algorithm

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

               def writeXML(hAlgorithm, inContext = nil)

                  # classes used
                  citationClass = CI_Citation.new(@xml, @hResponseObj)

                  outContext = 'algorithm'
                  outContext = inContext + ' ' + outContext unless inContext.nil?

                  @xml.tag!('gmi:LE_Algorithm') do

                     # algorithm - citation {CI_Citation} (required)
                     hCitation = hAlgorithm[:citation]
                     unless hCitation.empty?
                        @xml.tag!('gmi:citation') do
                           citationClass.writeXML(hCitation, outContext)
                        end
                     end
                     if hCitation.empty?
                        @NameSpace.issueWarning(390, 'gmi:citation', outContext)
                     end

                     # algorithm - description (required)
                     unless hAlgorithm[:description].nil?
                        @xml.tag!('gmi:description') do
                           @xml.tag!('gco:CharacterString', hAlgorithm[:description])
                        end
                     end
                     if hAlgorithm[:description].nil?
                        @NameSpace.issueWarning(391, 'gmi:description', outContext)
                     end

                  end # gmi:LE_Algorithm tag
               end # writeXML
            end # LE_Algorithm class

         end
      end
   end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.19.0.pre.beta.31 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.30 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.29 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.28 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.27 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.26 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.13 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.12 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.11 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.10 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.9 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.8 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.19.0.pre.beta.7 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.18.4 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.18.2 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.18.1 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.18.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.18.0rc9 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.18.0rc8 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb
adiwg-mdtranslator-2.18.0rc7 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_algorithm.rb