Sha256: f26bf0e468cb53b305968b540cff11e42e906445cb94b935eb627a258f4073d3

Contents?: true

Size: 827 Bytes

Versions: 1

Compression:

Stored size: 827 Bytes

Contents

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

# History:
# 	Stan Smith 2014-04-30 original script

module Md_GeoCoordSystem

	def self.unpack(hGeoCrs, intElement)

		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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.10.2 lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoCoordSystem.rb