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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalExtent.rb', line 17
def self.unpack(hVertical, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hVertical.empty?
@MessagePath.issueWarning(930, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intVertical = intMetadataClass.newVerticalExtent
outContext = 'vertical extent'
outContext = inContext + ' > ' + outContext unless inContext.nil?
if hVertical.has_key?('description')
unless hVertical['description'] == ''
intVertical[:description] = hVertical['description']
end
end
if hVertical.has_key?('minValue')
intVertical[:minValue] = hVertical['minValue']
end
if intVertical[:minValue].nil? || intVertical[:minValue] == ''
@MessagePath.issueError(931, responseObj, inContext)
end
if hVertical.has_key?('maxValue')
intVertical[:maxValue] = hVertical['maxValue']
end
if intVertical[:maxValue].nil? || intVertical[:maxValue] == ''
@MessagePath.issueError(932, responseObj, inContext)
end
if hVertical.has_key?('crsId')
hObject = hVertical['crsId']
unless hObject.empty?
hReturn = SpatialReferenceSystem.unpack(hObject, responseObj, outContext)
unless hReturn.nil?
intVertical[:crsId] = hReturn
end
end
end
if intVertical[:crsId].empty?
@MessagePath.issueError(933, responseObj, inContext)
end
return intVertical
end
|