Sha256: 08471f8f4274aaaff618996b7659c924f2a6f3d38a54328e75112d560a5f073c

Contents?: true

Size: 1.58 KB

Versions: 4

Compression:

Stored size: 1.58 KB

Contents

# Reader - fgdc to internal data structure
# unpack fgdc map projection - robinson

# History:
#  Stan Smith 2017-10-18 original script

require 'nokogiri'
require 'adiwg/mdtranslator/internal/internal_metadata_obj'
require_relative 'projection_common'

module ADIWG
   module Mdtranslator
      module Readers
         module Fgdc

            module RobinsonProjection

               def self.unpack(xParams, hProjection, hResponseObj)

                  # map projection 4.1.2.1.17 (robinson) - Robinson
                  unless xParams.empty?
                     paramCount = 0
                     hProjection[:projection] = 'robinson'
                     hProjection[:projectionName] = 'Robinson'

                     # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
                     paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)

                     # -> ReferenceSystemParameters.projection.falseEasting
                     # -> ReferenceSystemParameters.projection.falseNorthing
                     paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)

                     # verify parameter count
                     if paramCount == 3
                        return hProjection
                     else
                        hResponseObj[:readerExecutionMessages] << 'robinson projection is missing one or more parameters'
                        return nil
                     end
                  end

                  return nil

               end

            end

         end
      end
   end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.9.2 lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb
adiwg-mdtranslator-2.9.1 lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb
adiwg-mdtranslator-2.9.0 lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb
adiwg-mdtranslator-2.8.0 lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb