Module: Adiwg_GeoCoordSystem

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

Overview

History: Stan Smith 2014-04-30 original script

Class Method Summary collapse

Class Method Details

.unpack(hGeoCrs, intElement) ⇒ 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
41
42
43
44
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_geoCoordSystem.rb', line 9

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