Sha256: 3e666f2089494a6f95765bf116f3359026ea7a4e146c696c12ad1e584e19f723

Contents?: true

Size: 1.91 KB

Versions: 16

Compression:

Stored size: 1.91 KB

Contents

# unpack GeoJSON properties
# Reader - ADIwg JSON V1 to internal data structure

# History:
# 	Stan Smith 2014-04-30 original script
#   Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
#   Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
#   Stan Smith 2015-07-14 refactored to remove global namespace constants

module ADIWG
    module Mdtranslator
        module Readers
            module MdJson

                module GeoCoordSystem

                    def self.unpack(hGeoCrs, intElement, responseObj)

                        intMetadataClass = InternalMetadata.new
                        intSRS = intMetadataClass.newSRS

                        # get coordinate reference system
                        # null crs will default to CRS84 in writer
                        if hGeoCrs.has_key?('properties')
                            hCRSProp = hGeoCrs['properties']

                            if hCRSProp.has_key?('name')
                                s = hCRSProp['name']
                                if s != ''
                                    intSRS[:srsName] = s
                                end
                            end

                            if hCRSProp.has_key?('href')
                                s = hCRSProp['href']
                                if s != ''
                                    intSRS[:srsHref] = s
                                end
                            end

                            if hCRSProp.has_key?('type')
                                s = hCRSProp['type']
                                if s != ''
                                    intSRS[:srsType] = s
                                end
                            end

                            intElement[:elementSrs] = intSRS

                        end

                    end

                end

            end
        end
    end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
adiwg-mdtranslator-1.4.0 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta14 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta13 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta12 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta11 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta10 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta9 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta8 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta7 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta6 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta5 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta4 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta3 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta2 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.4.0.beta1 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb
adiwg-mdtranslator-1.3.0 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geoCoordSystem.rb