Sha256: f55b0fd54b122f3ea966bf89dd8d76f5875bbfeecbef4e7c4a6a4bc7fed094c2
Contents?: true
Size: 1.9 KB
Versions: 36
Compression:
Stored size: 1.9 KB
Contents
# ISO <<Class>> Measure # 19115-2 writer output in XML # History: # Stan Smith 2018-04-19 add error and warning messaging # Stan Smith 2016-11-22 original script. require_relative '../iso19115_2_writer' module ADIWG module Mdtranslator module Writers module Iso19115_2 class Measure def initialize(xml, hResponseObj) @xml = xml @hResponseObj = hResponseObj @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2 end def writeXML(hMeasure, inContext = nil) # measure type = hMeasure[:type] value = hMeasure[:value] uom = hMeasure[:unitOfMeasure] # ISO 19115-2 will not accept spaces in uom uom.gsub!(/\s+/, '') haveType = false if type == 'distance' @xml.tag!('gco:Distance', {'uom' => uom}, value) haveType = true end if type == 'length' @xml.tag!('gco:Length', {'uom' => uom}, value) haveType = true end if type == 'angle' @xml.tag!('gco:Angle', {'uom' => uom}, value) haveType = true end if type == 'measure' @xml.tag!('gco:Measure', {'uom' => uom}, value) haveType = true end if type == 'scale' @xml.tag!('gco:Scale', {'uom' => uom}, value) haveType = true end unless haveType @NameSpace.issueWarning(360, nil, inContext) end end # write XML end # CI_Telephone class end end end end
Version data entries
36 entries across 36 versions & 1 rubygems