Module: Adiwg_Resolution

Defined in:
lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_resolution.rb

Overview

History: Stan Smith 2013-11-26 original script

Class Method Summary collapse

Class Method Details

.unpack(hResolution) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_resolution.rb', line 9

def self.unpack(hResolution)

	# instance classes needed in script
	intMetadataClass = InternalMetadata.new
	intResolution = intMetadataClass.newResolution

	# resolution - equivalent scale
	if hResolution.has_key?('equivalentScale')
		s = hResolution['equivalentScale']
		if s != ''
			intResolution[:equivalentScale] = s
		end
	end

	# resolution - distance
	if hResolution.has_key?('distance')
		s = hResolution['distance']
		if s != ''
			intResolution[:distance] = s
		end
	end

	# resolution - uom
	if hResolution.has_key?('uom')
		s = hResolution['uom']
		if s != ''
			intResolution[:distanceUOM] = s
		end
	end

	return intResolution
end