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
|
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb', line 22
def self.unpack(xMapGrid, hResponseObj)
intMetadataClass = InternalMetadata.new
hProjection = intMetadataClass.newProjection
hGridSystemId = intMetadataClass.newIdentifier
hProjectionId = intMetadataClass.newIdentifier
hProjection[:gridIdentifier] = hGridSystemId
hProjection[:projectionIdentifier] = hProjectionId
gridName = xMapGrid.xpath('./gridsysn').text
unless gridName.empty?
hGridSystemId[:name] = gridName
end
if gridName.empty?
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: grid system name is missing'
end
xUTM = xMapGrid.xpath('./utm')
unless xUTM.empty?
return MapGridUtm.unpack(xUTM, hProjection, hResponseObj)
end
xUPS = xMapGrid.xpath('./ups')
unless xUPS.empty?
return MapGridUps.unpack(xUPS, hProjection, hResponseObj)
end
xStateP = xMapGrid.xpath('./spcs')
unless xStateP.empty?
return MapGridStatePlane.unpack(xStateP, hProjection, hResponseObj)
end
xArc = xMapGrid.xpath('./arcsys')
unless xArc.empty?
return MapGridEqualArcSecond.unpack(xArc, hProjection, hResponseObj)
end
otherG = xMapGrid.xpath('./othergrd').text
unless otherG.empty?
return MapGridOther.unpack(otherG, hProjection)
end
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: grid system is missing'
return hProjection
end
|