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
|
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb', line 17
def self.unpack(xGeographic, hResponseObj)
intMetadataClass = InternalMetadata.new
hResolution = intMetadataClass.newSpatialResolution
hGeoResolution = intMetadataClass.newGeographicResolution
latResolution = xGeographic.xpath('./latres').text
unless latResolution.empty?
hGeoResolution[:latitudeResolution] = latResolution.to_f
end
if latResolution.empty?
hResponseObj[:readerExecutionMessages] <<
'WARNING: FGDC reader: geographic latitude resolution is missing'
end
longResolution = xGeographic.xpath('./longres').text
unless longResolution.empty?
hGeoResolution[:longitudeResolution] = longResolution.to_f
end
if longResolution.empty?
hResponseObj[:readerExecutionMessages] <<
'WARNING: FGDC reader: geographic longitude resolution is missing'
end
unitMeasure = xGeographic.xpath('./geogunit').text
unless unitMeasure.empty?
hGeoResolution[:unitOfMeasure] = unitMeasure
end
if unitMeasure.empty?
hResponseObj[:readerExecutionMessages] <<
'WARNING: FGDC reader: geographic latitude/longitude units are missing'
end
hResolution[:geographicResolution] = hGeoResolution
return hResolution
end
|