wms_getcapabilities 0.1.0.3 → 0.1.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,11 +7,11 @@ module WmsGetcapabilities
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def get_capabilities
|
10
|
-
service
|
11
|
-
request
|
10
|
+
service = "WMS"
|
11
|
+
request = "GetCapabilities"
|
12
12
|
|
13
|
-
response
|
14
|
-
@parser
|
13
|
+
response = open("#{@root_url}/wms?SERVICE=#{service}&request=#{request}")
|
14
|
+
@parser = Parser.new(response)
|
15
15
|
end
|
16
16
|
|
17
17
|
def layers
|
@@ -1,24 +1,31 @@
|
|
1
1
|
module WmsGetcapabilities
|
2
2
|
class Layer
|
3
|
-
attr_accessor :name, :title, :crs, :bbox, :description
|
3
|
+
attr_accessor :name, :title, :crs, :bbox, :description, :dimension_type, :dimension_values
|
4
4
|
|
5
|
-
def initialize(name, title, crs, bbox, description)
|
6
|
-
@name
|
7
|
-
@title
|
8
|
-
@crs
|
9
|
-
@bbox
|
10
|
-
@description
|
5
|
+
def initialize(name, title, crs, bbox, description, dimension_type, dimension_values)
|
6
|
+
@name = name
|
7
|
+
@title = title
|
8
|
+
@crs = crs
|
9
|
+
@bbox = bbox
|
10
|
+
@description = description
|
11
|
+
@dimension_type = dimension_type
|
12
|
+
@dimension_values = dimension_values
|
11
13
|
end
|
12
14
|
|
13
15
|
def self.from_xml(node)
|
14
16
|
children = node.children
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
|
18
|
+
name = children.at("Name").text
|
19
|
+
title = children.at("Title").text
|
20
|
+
crs = children.at("CRS").text
|
21
|
+
description = children.at("Abstract").text
|
22
|
+
dimension = children.at("Dimension")
|
23
|
+
box = children.search("BoundingBox").last
|
24
|
+
bbox = [box.attr("minx"), box.attr("miny"), box.attr("maxx"), box.attr("maxy")]
|
25
|
+
dimension_type = dimension.attr("name") ||= nil
|
26
|
+
dimension_values = dimension.text ||= nil
|
27
|
+
|
28
|
+
l = Layer.new(name, title, crs, bbox, description, dimension_type, dimension_values)
|
22
29
|
end
|
23
30
|
|
24
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wms_getcapabilities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &2164716700 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2164716700
|
25
25
|
description: Interface between ruby and Geoserver WMS GetCapabilities
|
26
26
|
email:
|
27
27
|
- jchapron@dotgee.fr
|