Module: ADIWG::Mdtranslator::Readers::Fgdc::HorizontalReference

Defined in:
lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb

Class Method Summary collapse

Class Method Details

.unpack(xHorizontalRef, hResourceInfo, hResponseObj) ⇒ Object



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
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb', line 20

def self.unpack(xHorizontalRef, hResourceInfo, hResponseObj)

   # horizontal reference 4.1.1 (geograph) - geographic resolution
   xGeographic = xHorizontalRef.xpath('./geograph')
   unless xGeographic.empty?
      hResolution = GeographicResolution.unpack(xGeographic, hResponseObj)
      unless hResolution.nil?
         hResourceInfo[:spatialResolutions] << hResolution
      end
   end

   # horizontal reference 4.1.2 (planar) - planar coordinate system []
   axPlanar = xHorizontalRef.xpath('./planar')
   unless axPlanar.empty?
      axPlanar.each do |xPlanar|
         PlanarReference.unpack(xPlanar, hResourceInfo, hResponseObj)
      end
   end

   # horizontal reference 4.1.3 (local) - local coordinate system
   xLocal = xHorizontalRef.xpath('./local')
   unless xLocal.empty?
      hReferenceSystem = MapLocalSystem.unpack(xLocal, hResponseObj)
      unless hReferenceSystem.nil?
         hResourceInfo[:spatialReferenceSystems] << hReferenceSystem
      end
   end

   # horizontal reference 4.1.4 (geodetic) - parameters for shape of earth
   xGeodetic = xHorizontalRef.xpath('./geodetic')
   unless xGeodetic.empty?
      hReferenceSystem = GeodeticReference.unpack(xHorizontalRef, hResponseObj)
      unless hReferenceSystem.nil?
         hResourceInfo[:spatialReferenceSystems] << hReferenceSystem
      end
   end

   return hResourceInfo

end