Class: ADIWG::Mdtranslator::Writers::Fgdc::PlanarReference

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

Instance Method Summary collapse

Constructor Details

#initialize(xml, hResponseObj) ⇒ PlanarReference

Returns a new instance of PlanarReference.



20
21
22
23
# File 'lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb', line 20

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

Instance Method Details

#writeXML(aSpaceRefs, aRepTypes, aResolutions, inContext = nil) ⇒ Object



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
# File 'lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb', line 25

def writeXML(aSpaceRefs, aRepTypes, aResolutions, inContext = nil)

   # classes used
   classMap = PlanarMap.new(@xml, @hResponseObj)
   classGrid = PlanarGrid.new(@xml, @hResponseObj)
   classLocal = PlanarLocal.new(@xml, @hResponseObj)
   classInfo = PlanarInformation.new(@xml, @hResponseObj)

   outContext = 'horizontal planar'
   outContext = inContext + ' ' + outContext unless inContext.nil?

   # <- planar 4.1.2 ...
   # <- spatialReferences[].systemParameterSet.projection (map) 4.1.2.1
   # <- spatialReferences[].systemParameterSet.projection (grid) 4.1.2.2
   # <- spatialReferences[].systemParameterSet.projection (localPlanar) 4.1.2.3
   aSpaceRefs.each do |hSpaceRef|
      unless hSpaceRef[:systemParameterSet].empty?
         unless hSpaceRef[:systemParameterSet][:projection].empty?
            hProjection = hSpaceRef[:systemParameterSet][:projection]
            unless hProjection[:gridIdentifier].empty?
               classGrid.writeXML(hProjection, outContext)
               break
            end
            if hProjection[:projectionIdentifier][:identifier] == 'localPlanar'
               classLocal.writeXML(hProjection, outContext)
               break
            end
            classMap.writeXML(hProjection, outContext)
         end
      end
   end

   # planar 4.1.2.4 (planci) - planar coordinate information
   classInfo.writeXML(aRepTypes, aResolutions, outContext)

end