Class: ADIWG::Mdtranslator::Writers::Iso19115_2::SpatialRepresentation

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

Instance Method Summary collapse

Constructor Details

#initialize(xml, hResponseObj) ⇒ SpatialRepresentation

Returns a new instance of SpatialRepresentation.



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

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

Instance Method Details

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

def writeXML(hRepresentation)

   # classes used
   gridClass = MD_GridSpatialRepresentation.new(@xml, @hResponseObj)
   vectorClass = MD_VectorSpatialRepresentation.new(@xml, @hResponseObj)
   rectifiedClass = MD_Georectified.new(@xml, @hResponseObj)
   referenceClass = MD_Georeferenceable.new(@xml, @hResponseObj)

   # spatial representation - grid
   unless hRepresentation[:gridRepresentation].empty?
      gridClass.writeXML(hRepresentation[:gridRepresentation])
   end

   # spatial representation - vector
   unless hRepresentation[:vectorRepresentation].empty?
      vectorClass.writeXML(hRepresentation[:vectorRepresentation])
   end

   # spatial representation - georectified
   unless hRepresentation[:georectifiedRepresentation].empty?
      rectifiedClass.writeXML(hRepresentation[:georectifiedRepresentation])
   end

   # spatial representation - georeferenceable
   unless hRepresentation[:georeferenceableRepresentation].empty?
      referenceClass.writeXML(hRepresentation[:georeferenceableRepresentation])
   end

end