Class: ADIWG::Mdtranslator::Writers::Fgdc::PlanarLocal

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

Instance Method Summary collapse

Constructor Details

#initialize(xml, hResponseObj) ⇒ PlanarLocal

Returns a new instance of PlanarLocal.



18
19
20
21
22
# File 'lib/adiwg/mdtranslator/writers/fgdc/classes/class_localPlanar.rb', line 18

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

Instance Method Details

#writeXML(hProjection, inContext = nil) ⇒ 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
53
54
55
56
57
# File 'lib/adiwg/mdtranslator/writers/fgdc/classes/class_localPlanar.rb', line 24

def writeXML(hProjection, inContext = nil)

   # localPLANAR is not the same as localSYSTEM in fgdc
   # however they use the same 'local' object
   # local system sets projectionIdentifier.identifier = 'localSystem'
   # local planar sets projectionIdentifier.identifier = 'localPlanar'

   # classes used
   classTags = MapProjectionTags.new(@xml, @hResponseObj)

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

   hProjectionId = hProjection[:projectionIdentifier]
   hLocal = hProjection[:local]

   if hLocal.empty?
      @NameSpace.issueError(470, outContext)
      return
   end

   # planar 4.1.2.3 (localp) - local planar
   if hProjectionId[:identifier] == 'localPlanar'
      hProjectionId[:name] = nil unless hProjectionId.has_key?(:name)
      if hProjectionId[:name].nil?
         hProjectionId[:name] = 'Local Planar Coordinate System Fixed to Earth'
      end
      @xml.tag!('localp') do
         classTags.write_localDesc(hProjection, outContext)
         classTags.write_localGeoInfo(hProjection, outContext)
      end
   end

end