Sha256: ab149050997690047b5f4bd26c442e4ddc186fc3c22448a7bb4d293b4f23b52d

Contents?: true

Size: 1.81 KB

Versions: 6

Compression:

Stored size: 1.81 KB

Contents

# Reader - fgdc to internal data structure
# unpack fgdc horizontal data local reference

# History:
#  Stan Smith 2017-12-29 original script

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

module ADIWG
   module Mdtranslator
      module Readers
         module Fgdc

            module LocalSystem

               def self.unpack(xLocal, hResponseObj)

                  # instance classes needed in script
                  intMetadataClass = InternalMetadata.new

                  hProjection = intMetadataClass.newProjection
                  hProjection[:projection] = 'localSystem'
                  hProjection[:projectionName] = 'local coordinate system'

                  # local planar 4.1.3.1 (localdes) - local description
                  # -> referenceSystemParameters.projection.localPlanarDescription
                  description = xLocal.xpath('./localdes').text
                  unless description.empty?
                     hProjection[:localPlanarDescription] = description
                  end

                  # local planar 4.1.3.2 (localgeo) - local georeference information
                  # -> referenceSystemParameters.projection.localPlanarGeoreference
                  georeference = xLocal.xpath('./localgeo').text
                  unless georeference.empty?
                     hProjection[:localPlanarGeoreference] = georeference
                  end

                  hReferenceSystem = intMetadataClass.newSpatialReferenceSystem
                  hSystemParameters = intMetadataClass.newReferenceSystemParameterSet
                  hSystemParameters[:projection] = hProjection
                  hReferenceSystem[:systemParameterSet] = hSystemParameters

                  return hReferenceSystem

               end

            end

         end
      end
   end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.13.3 lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb
adiwg-mdtranslator-2.13.2 lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb
adiwg-mdtranslator-2.13.1 lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb
adiwg-mdtranslator-2.13.0 lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb
adiwg-mdtranslator-2.12.0 lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb
adiwg-mdtranslator-2.12.0.pre lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb