Class: ADIWG::Mdtranslator::Writers::Iso19115_2::MD_VectorSpatialRepresentation

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

Instance Method Summary collapse

Constructor Details

#initialize(xml, hResponseObj) ⇒ MD_VectorSpatialRepresentation

Returns a new instance of MD_VectorSpatialRepresentation.



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

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

Instance Method Details

#writeXML(hVector) ⇒ 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
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vectorRepresentation.rb', line 22

def writeXML(hVector)

   # classes used
   codelistClass = MD_Codelist.new(@xml, @hResponseObj)
   geoObjClass = MD_GeometricObjects.new(@xml, @hResponseObj)

   @xml.tag!('gmd:MD_VectorSpatialRepresentation') do

      # vector representation - topology level
      s = hVector[:topologyLevel]
      unless s.nil?
         @xml.tag!('gmd:topologyLevel') do
            codelistClass.writeXML('gmd', 'iso_topologyLevel', s)
         end
      end
      if s.nil? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:topologyLevel')
      end

      # vector representation - geometric objects [{MD_GeometricObjects}]
      aGeoObjs = hVector[:vectorObject]
      aGeoObjs.each do |hGeoObj|
         @xml.tag!('gmd:geometricObjects') do
            geoObjClass.writeXML(hGeoObj)
         end
      end
      if aGeoObjs.empty? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:geometricObjects')
      end

   end # gmd:MD_VectorSpatialRepresentation tag
end