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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapProjection.rb', line 40
def self.unpack(xMapProjection, hResponseObj)
intMetadataClass = InternalMetadata.new
hProjection = intMetadataClass.newProjection
hIdentifier = intMetadataClass.newIdentifier
hProjection[:projectionIdentifier] = hIdentifier
name = xMapProjection.xpath('./mapprojn').text
unless name.empty?
hIdentifier[:name] = name
end
if name.empty?
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: map projection name is missing'
end
xAlbers = xMapProjection.xpath('./albers')
unless xAlbers.empty?
hIdentifier[:identifier] = 'albers'
hIdentifier[:name] = 'Albers Conical Equal Area' if name.empty?
return AlbersProjection.unpack(xAlbers, hProjection, hResponseObj)
end
xAzimequi = xMapProjection.xpath('./azimequi')
unless xAzimequi.empty?
hIdentifier[:identifier] = 'azimuthalEquidistant'
hIdentifier[:name] = 'Azimuthal Equidistant' if name.empty?
return AzimuthEquidistantProjection.unpack(xAzimequi, hProjection, hResponseObj)
end
xEquiCon = xMapProjection.xpath('./equicon')
unless xEquiCon.empty?
hIdentifier[:identifier] = 'equidistantConic'
hIdentifier[:name] = 'Equidistant Conic' if name.empty?
return EquidistantConicProjection.unpack(xEquiCon, hProjection, hResponseObj)
end
xEquirec = xMapProjection.xpath('./equirect')
unless xEquirec.empty?
hIdentifier[:identifier] = 'equirectangular'
hIdentifier[:name] = 'Equirectangular' if name.empty?
return EquirectangularProjection.unpack(xEquirec, hProjection, hResponseObj)
end
xGenVert = xMapProjection.xpath('./gvnsp')
unless xGenVert.empty?
hIdentifier[:identifier] = 'generalVertical'
hIdentifier[:name] = 'General Vertical Near-sided Perspective' if name.empty?
return GeneralVerticalProjection.unpack(xGenVert, hProjection, hResponseObj)
end
xGeomonic = xMapProjection.xpath('./gnomonic')
unless xGeomonic.empty?
hIdentifier[:identifier] = 'gnomonic'
hIdentifier[:name] = 'Gnomonic' if name.empty?
return GnomonicProjection.unpack(xGeomonic, hProjection, hResponseObj)
end
xLambertA = xMapProjection.xpath('./lamberta')
unless xLambertA.empty?
hIdentifier[:identifier] = 'lambertEqualArea'
hIdentifier[:name] = 'Lambert Azimuthal Equal Area' if name.empty?
return LambertEqualAreaProjection.unpack(xLambertA, hProjection, hResponseObj)
end
xLambertC = xMapProjection.xpath('./lambertc')
unless xLambertC.empty?
hIdentifier[:identifier] = 'lambertConic'
hIdentifier[:name] = 'Lambert Conformal Conic' if name.empty?
return LambertConicProjection.unpack(xLambertC, hProjection, hResponseObj)
end
xMercator = xMapProjection.xpath('./mercator')
unless xMercator.empty?
hIdentifier[:identifier] = 'mercator'
hIdentifier[:name] = 'Mercator' if name.empty?
return MercatorProjection.unpack(xMercator, hProjection, hResponseObj)
end
xAlaska = xMapProjection.xpath('./modsak')
unless xAlaska.empty?
hIdentifier[:identifier] = 'alaska'
hIdentifier[:name] = 'Modified Stereographic for Alaska' if name.empty?
return ModifiedAlaskaProjection.unpack(xAlaska, hProjection, hResponseObj)
end
xMiller = xMapProjection.xpath('./miller')
unless xMiller.empty?
hIdentifier[:identifier] = 'miller'
hIdentifier[:name] = 'Miller Cylindrical' if name.empty?
return MillerCylinderProjection.unpack(xMiller, hProjection, hResponseObj)
end
xObliqueM = xMapProjection.xpath('./obqmerc')
unless xObliqueM.empty?
hIdentifier[:identifier] = 'obliqueMercator'
hIdentifier[:name] = 'Oblique Mercator' if name.empty?
return ObliqueMercatorProjection.unpack(xObliqueM, hProjection, hResponseObj)
end
xOrtho = xMapProjection.xpath('./orthogr')
unless xOrtho.empty?
hIdentifier[:identifier] = 'orthographic'
hIdentifier[:name] = 'Orthographic' if name.empty?
return OrthographicProjection.unpack(xOrtho, hProjection, hResponseObj)
end
xPolarStereo = xMapProjection.xpath('./polarst')
unless xPolarStereo.empty?
hIdentifier[:identifier] = 'polarStereo'
hIdentifier[:name] = 'Polar Stereographic' if name.empty?
return PolarStereoProjection.unpack(xPolarStereo, hProjection, hResponseObj)
end
xPolycon = xMapProjection.xpath('./polycon')
unless xPolycon.empty?
hIdentifier[:identifier] = 'polyconic'
hIdentifier[:name] = 'Polyconic' if name.empty?
return PolyconicProjection.unpack(xPolycon, hProjection, hResponseObj)
end
xRobin = xMapProjection.xpath('./robinson')
unless xRobin.empty?
hIdentifier[:identifier] = 'robinson'
hIdentifier[:name] = 'Robinson' if name.empty?
return RobinsonProjection.unpack(xRobin, hProjection, hResponseObj)
end
xSinu = xMapProjection.xpath('./sinusoid')
unless xSinu.empty?
hIdentifier[:identifier] = 'sinusoidal'
hIdentifier[:name] = 'Sinusoidal' if name.empty?
return SinusoidalProjection.unpack(xSinu, hProjection, hResponseObj)
end
xSpaceO = xMapProjection.xpath('./spaceobq')
unless xSpaceO.empty?
hIdentifier[:identifier] = 'spaceOblique'
hIdentifier[:name] = 'Space Oblique Mercator (Landsat)' if name.empty?
return SpaceObliqueProjection.unpack(xSpaceO, hProjection, hResponseObj)
end
xStereo = xMapProjection.xpath('./stereo')
unless xStereo.empty?
hIdentifier[:identifier] = 'stereographic'
hIdentifier[:name] = 'Stereographic' if name.empty?
return StereographicProjection.unpack(xStereo, hProjection, hResponseObj)
end
xTransMer = xMapProjection.xpath('./transmer')
unless xTransMer.empty?
hIdentifier[:identifier] = 'transverseMercator'
hIdentifier[:name] = 'Transverse Mercator' if name.empty?
return TransverseMercatorProjection.unpack(xTransMer, hProjection, hResponseObj)
end
xVanDerG = xMapProjection.xpath('./vdgrin')
unless xVanDerG.empty?
hIdentifier[:identifier] = 'grinten'
hIdentifier[:name] = 'Van Der Grinten' if name.empty?
return VanDerGrintenProjection.unpack(xVanDerG, hProjection, hResponseObj)
end
xParamSet = xMapProjection.xpath('./mapprojp')
unless xParamSet.empty?
hIdentifier[:identifier] = 'parameters'
hIdentifier[:name] = 'Projection Parameters' if name.empty?
return ProjectionParameters.unpack(xParamSet, hProjection, hResponseObj)
end
return nil
end
|