class ADIWG::Mdtranslator::Writers::Fgdc::PlanarLocal

Public Class Methods

new(xml, hResponseObj) click to toggle source
# 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

Public Instance Methods

writeXML(hProjection, inContext = nil) click to toggle source
# 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