Class: ROGC::Formats::WMSCapabilities::V1_3

Inherits:
V1_1 show all
Defined in:
lib/rogc/formats/wms_capabilities/v1_3.rb

Direct Known Subclasses

V1_3_0

Constant Summary collapse

READERS_v1_3 =
{
  'wms' => {
    'WMS_Capabilities' => lambda { |node, obj|
      read_child_nodes(node, obj)
    }
  }
}

Instance Attribute Summary

Attributes inherited from XML::Base

#xml_readers

Instance Method Summary collapse

Methods inherited from V1

#get_bounding_box, #get_srs

Methods inherited from XML::VersionedOGC

#get_parser, #get_version, #read

Methods inherited from XML::Base

#child_value, #read_child_nodes, #read_node

Constructor Details

#initializeV1_3

Returns a new instance of V1_3.



14
15
16
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rogc/formats/wms_capabilities/v1_3.rb', line 14

def initialize
  super
  #@xml_readers= xml_readers.merge(
  #  'wms' => READERS_v1_3_0['wms']
  #)
  @xml_readers= xml_readers.merge( {
      'wms' => @xml_readers['wms'].merge({
        'WMS_Capabilities' => lambda { |node, obj|
          read_child_nodes(node, obj)
        },
        'LayerLimit' => lambda { |node, obj|
          obj.layer_limit = child_value(node).to_i
        },
        'MaxWidth' => lambda { |node, obj|
          obj.layer_limit = child_value(node).to_i
        },
        'MaxHeight' => lambda { |node, obj|
          obj.layer_limit = child_value(node).to_i
        },
        'BoundingBox' => lambda { |node, obj|
          # raise super['wms']['BOundingBox'].inspect
          bbox = get_bounding_box(node, obj)
          bbox.srs = node['CRS']
          obj.bbox ||= {}
          obj.bbox[bbox.srs] = bbox

          obj.bbox
        },
        'CRS' => lambda { |node, obj|
          get_srs(node, obj)
        },
        'EX_GeographicBoundingBox' => lambda { |node, obj|
          # replacement of LatLonBoundingBox
          obj.llbbox = [];
          read_child_nodes(node, obj.llbbox)
        },
        'westBoundLongitude' => lambda { |node, obj|
          obj[0] = child_value(node)
        },
        'eastBoundLongitude' => lambda { |node, obj|
          obj[2] = child_value(node)
        },
        'southBoundLatitude' => lambda { |node, obj|
          obj[1] = child_value(node)
        },
        'northBoundLatitude' => lambda { |node, obj|
          obj[3] = child_value(node)
        },
        'MinScaleDenominator' => lambda { |node, obj|
          # obj.maxScale = parseFloat(this.getChildValue(node)).toPrecision(16);
          obj.max_scale = child_value(node).to_f.round(16)
        },
        'MaxScaleDenominator' => lambda { |node, obj|
          # obj.minScale = parseFloat(this.getChildValue(node)).toPrecision(16);
          obj.max_scale = child_value(node).to_f.round(16)
        },
        'Keyword' => lambda { |node, obj|
          keyword = {
            'value' => child_value(node),
            'vocabulary' => node['vocabulary']
          }

          obj.keywords << keyword if (obj.keywords)
        }
      })
  })
end