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
|
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_statePlane.rb', line 20
def self.unpack(xStateP, hProjection, hResponseObj)
hGridSystemId = hProjection[:gridIdentifier]
hProjectionId = hProjection[:projectionIdentifier]
hGridSystemId[:identifier] = 'spcs'
hGridSystemId[:name] = 'State Plane Coordinate System' if hGridSystemId[:name].nil?
zone = xStateP.xpath('./spcszone').text
unless zone.empty?
hProjection[:gridZone] = zone
end
if zone.empty?
hResponseObj[:readerExecutionMessages] <<
'WARNING: FGDC reader: state plane zone number is missing'
end
xLambert = xStateP.xpath('./lambertc')
unless xLambert.empty?
hProjectionId[:identifier] = 'lambertConic'
hProjectionId[:name] = 'Lambert Conformal Conic'
return LambertConicProjection.unpack(xLambert, hProjection, hResponseObj)
end
xTransMer = xStateP.xpath('./transmer')
unless xTransMer.empty?
hProjectionId[:identifier] = 'transverseMercator'
hProjectionId[:name] = 'Transverse Mercator'
return TransverseMercatorProjection.unpack(xTransMer, hProjection, hResponseObj)
end
xObliqueM = xStateP.xpath('./obqmerc')
unless xObliqueM.empty?
hProjectionId[:identifier] = 'obliqueMercator'
hProjectionId[:name] = 'Oblique Mercator'
return ObliqueMercatorProjection.unpack(xObliqueM, hProjection, hResponseObj)
end
xPolyCon = xStateP.xpath('./polycon')
unless xPolyCon.empty?
hProjectionId[:identifier] = 'polyconic'
hProjectionId[:name] = 'Polyconic'
return PolyconicProjection.unpack(xPolyCon, hProjection, hResponseObj)
end
hResponseObj[:readerExecutionMessages] <<
'WARNING: FGDC reader: UPS state plane projection definition is missing'
return hProjection
end
|