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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialRepresentation.rb', line 20
def self.unpack(hRepresent, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hRepresent.empty?
@MessagePath.issueWarning(790, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intRepresent = intMetadataClass.newSpatialRepresentation
outContext = 'spatial representation'
outContext = inContext + ' > ' + outContext unless inContext.nil?
haveOne = false
if hRepresent.has_key?('gridRepresentation')
hRep = hRepresent['gridRepresentation']
unless hRep.empty?
hObject = GridRepresentation.unpack(hRep, responseObj, outContext)
unless hObject.nil?
intRepresent[:gridRepresentation] = hObject
haveOne = true
end
end
end
if hRepresent.has_key?('vectorRepresentation')
hRep = hRepresent['vectorRepresentation']
unless hRep.empty?
hObject = VectorRepresentation.unpack(hRep, responseObj, outContext)
unless hObject.nil?
intRepresent[:vectorRepresentation] = hObject
haveOne = true
end
end
end
if hRepresent.has_key?('georectifiedRepresentation')
hRep = hRepresent['georectifiedRepresentation']
unless hRep.empty?
hObject = GeorectifiedRepresentation.unpack(hRep, responseObj, outContext)
unless hObject.nil?
intRepresent[:georectifiedRepresentation] = hObject
haveOne = true
end
end
end
if hRepresent.has_key?('georeferenceableRepresentation')
hRep = hRepresent['georeferenceableRepresentation']
unless hRep.empty?
hObject = GeoreferenceableRepresentation.unpack(hRep, responseObj, outContext)
unless hObject.nil?
intRepresent[:georeferenceableRepresentation] = hObject
haveOne = true
end
end
end
unless haveOne
@MessagePath.issueError(791, responseObj, inContext)
end
return intRepresent
end
|