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
|
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalPlanar.rb', line 22
def self.unpack(xPlanar, hResourceInfo, hResponseObj)
intMetadataClass = InternalMetadata.new
hReferenceSystem = intMetadataClass.newSpatialReferenceSystem
hSystemParameters = intMetadataClass.newReferenceSystemParameterSet
hProjection = {}
distanceUnits = nil
xPlanCI = xPlanar.xpath('./planci')
unless xPlanCI.empty?
planDU = xPlanCI.xpath('./plandu').text
unless planDU.empty?
distanceUnits = planDU
end
end
xMapProjection = xPlanar.xpath('./mapproj')
unless xMapProjection.empty?
hProjection = MapProjection.unpack(xMapProjection, hResponseObj)
end
xMapGrid = xPlanar.xpath('./gridsys')
unless xMapGrid.empty?
hProjection = MapGridSystem.unpack(xMapGrid, hResponseObj)
end
xMapLocal = xPlanar.xpath('./localp')
unless xMapLocal.empty?
hProjection = MapLocalPlanar.unpack(xMapLocal, hResponseObj)
end
unless hProjection.nil? || hProjection.empty?
unless distanceUnits.nil?
hProjection[:falseEastingNorthingUnits] = distanceUnits
end
hSystemParameters[:projection] = hProjection
hReferenceSystem[:systemParameterSet] = hSystemParameters
hResourceInfo[:spatialReferenceSystems] << hReferenceSystem
end
xPlanarCI = xPlanar.xpath('./planci')
unless xPlanarCI.empty?
PlanarCoordinateInformation.unpack(xPlanarCI, hResourceInfo, hResponseObj)
end
return hResourceInfo
end
|