rgeoserver 0.5.8.2 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -0
- data/Gemfile +4 -2
- data/README.rdoc +7 -3
- data/VERSION +1 -1
- data/lib/rgeoserver.rb +4 -1
- data/lib/rgeoserver/catalog.rb +84 -57
- data/lib/rgeoserver/datastore.rb +92 -18
- data/lib/rgeoserver/featuretype.rb +107 -35
- data/lib/rgeoserver/layer.rb +43 -43
- data/lib/rgeoserver/layergroup.rb +110 -35
- data/lib/rgeoserver/resource.rb +27 -27
- data/lib/rgeoserver/utils/boundingbox.rb +88 -0
- data/lib/rgeoserver/utils/shapefile_info.rb +89 -0
- data/rgeoserver.gemspec +5 -1
- data/spec/fixtures/datasets/vector/granules.zip +0 -0
- data/spec/integration/geoserver_spec.rb +170 -55
- data/spec/utils/boundingbox_spec.rb +77 -0
- data/spec/utils/shapefile_info_spec.rb +22 -0
- metadata +183 -29
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RGeoServer::BoundingBox do
|
4
|
+
subject { RGeoServer::BoundingBox.new }
|
5
|
+
|
6
|
+
it 'should reset' do
|
7
|
+
subject.to_a.should == [0.0, 0.0, 0.0, 0.0]
|
8
|
+
subject.reset
|
9
|
+
subject.to_a.should == [0.0, 0.0, 0.0, 0.0]
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should add point' do
|
13
|
+
subject.add -1, 0
|
14
|
+
subject.to_a.should == [-1, 0, -1, 0]
|
15
|
+
subject.add -1, -1
|
16
|
+
subject.to_a.should == [-1, -1, -1, 0]
|
17
|
+
subject.add 1, -1
|
18
|
+
subject.to_a.should == [-1, -1, 1, 0.0]
|
19
|
+
subject.add 1, 1
|
20
|
+
subject.to_a.should == [-1, -1, 1, 1]
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should expand with default' do
|
24
|
+
subject.add 1, 1
|
25
|
+
subject.expand
|
26
|
+
subject.to_a.should ==
|
27
|
+
[1 - RGeoServer::BoundingBox.epsilon, 1 - RGeoServer::BoundingBox.epsilon,
|
28
|
+
1 + RGeoServer::BoundingBox.epsilon, 1 + RGeoServer::BoundingBox.epsilon]
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should constrict with default' do
|
32
|
+
subject.add 1, 1
|
33
|
+
subject.constrict
|
34
|
+
subject.to_a.should ==
|
35
|
+
[1 - RGeoServer::BoundingBox.epsilon, 1 - RGeoServer::BoundingBox.epsilon,
|
36
|
+
1 + RGeoServer::BoundingBox.epsilon, 1 + RGeoServer::BoundingBox.epsilon]
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'should expand with rate' do
|
40
|
+
rate = 5
|
41
|
+
subject.add 1, 1
|
42
|
+
subject.expand rate
|
43
|
+
subject.to_a.should == [1 - rate, 1 - rate, 1 + rate, 1 + rate]
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should constrict with rate' do
|
47
|
+
rate = 5
|
48
|
+
subject.add 1, 1
|
49
|
+
subject.constrict rate
|
50
|
+
subject.to_a.should == [1 - rate, 1 - rate, 1 + rate, 1 + rate]
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'should constrict having non-zero area' do
|
54
|
+
rate = 0.2
|
55
|
+
subject.add -1, -1
|
56
|
+
subject.add 1, 1
|
57
|
+
subject.constrict rate
|
58
|
+
subject.to_a.should == [-1 + rate, -1 + rate, 1 - rate, 1 - rate]
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should generate geometry with different points' do
|
62
|
+
subject.add -1, -1
|
63
|
+
subject.add 1, 1
|
64
|
+
polygon = subject.to_geometry
|
65
|
+
polygon.geometry_type.should == RGeo::Feature::Polygon
|
66
|
+
polygon.as_text.should ==
|
67
|
+
"POLYGON ((-1.0 -1.0, 1.0 -1.0, 1.0 1.0, -1.0 1.0, -1.0 -1.0))"
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'should generate geometry with same points' do
|
71
|
+
subject.add 1, 1
|
72
|
+
polygon = subject.to_geometry
|
73
|
+
polygon.geometry_type.should == RGeo::Feature::Polygon
|
74
|
+
polygon.as_text.should ==
|
75
|
+
"POLYGON ((0.9999 0.9999, 1.0001 0.9999, 1.0001 1.0001, 0.9999 1.0001, 0.9999 0.9999))"
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RGeoServer::ShapefileInfo do
|
4
|
+
let :fixtures_dir do
|
5
|
+
File.expand_path File.join(File.dirname(__FILE__), "/../fixtures/")
|
6
|
+
end
|
7
|
+
|
8
|
+
let :shapefile_path do
|
9
|
+
File.expand_path File.join(fixtures_dir, 'datasets/vector/granules.shp')
|
10
|
+
end
|
11
|
+
|
12
|
+
subject { RGeoServer::ShapefileInfo.new shapefile_path }
|
13
|
+
|
14
|
+
it 'should return bounds' do
|
15
|
+
bbox = subject.bounds
|
16
|
+
bbox.to_a.should == [-123.0, 40.0, -122.0, 41.0]
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should return srid' do
|
20
|
+
subject.srid.should == 0
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgeoserver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
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:
|
12
|
+
date: 2013-02-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: nokogiri
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: mime-types
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: activesupport
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: activemodel
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ! '>='
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: '0'
|
66
86
|
type: :runtime
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: confstruct
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ! '>='
|
@@ -76,10 +101,63 @@ dependencies:
|
|
76
101
|
version: '0'
|
77
102
|
type: :runtime
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: rgeo
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rgeo-shapefile
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: rubyzip
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :runtime
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
80
158
|
- !ruby/object:Gem::Dependency
|
81
159
|
name: rake
|
82
|
-
requirement:
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
83
161
|
none: false
|
84
162
|
requirements:
|
85
163
|
- - ! '>='
|
@@ -87,10 +165,15 @@ dependencies:
|
|
87
165
|
version: '0'
|
88
166
|
type: :development
|
89
167
|
prerelease: false
|
90
|
-
version_requirements:
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
91
174
|
- !ruby/object:Gem::Dependency
|
92
175
|
name: shoulda
|
93
|
-
requirement:
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
94
177
|
none: false
|
95
178
|
requirements:
|
96
179
|
- - ! '>='
|
@@ -98,10 +181,15 @@ dependencies:
|
|
98
181
|
version: '0'
|
99
182
|
type: :development
|
100
183
|
prerelease: false
|
101
|
-
version_requirements:
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ! '>='
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0'
|
102
190
|
- !ruby/object:Gem::Dependency
|
103
191
|
name: bundler
|
104
|
-
requirement:
|
192
|
+
requirement: !ruby/object:Gem::Requirement
|
105
193
|
none: false
|
106
194
|
requirements:
|
107
195
|
- - ! '>='
|
@@ -109,10 +197,15 @@ dependencies:
|
|
109
197
|
version: 1.0.14
|
110
198
|
type: :development
|
111
199
|
prerelease: false
|
112
|
-
version_requirements:
|
200
|
+
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
202
|
+
requirements:
|
203
|
+
- - ! '>='
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: 1.0.14
|
113
206
|
- !ruby/object:Gem::Dependency
|
114
207
|
name: rspec
|
115
|
-
requirement:
|
208
|
+
requirement: !ruby/object:Gem::Requirement
|
116
209
|
none: false
|
117
210
|
requirements:
|
118
211
|
- - ! '>='
|
@@ -120,10 +213,15 @@ dependencies:
|
|
120
213
|
version: '0'
|
121
214
|
type: :development
|
122
215
|
prerelease: false
|
123
|
-
version_requirements:
|
216
|
+
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
none: false
|
218
|
+
requirements:
|
219
|
+
- - ! '>='
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
124
222
|
- !ruby/object:Gem::Dependency
|
125
223
|
name: yard
|
126
|
-
requirement:
|
224
|
+
requirement: !ruby/object:Gem::Requirement
|
127
225
|
none: false
|
128
226
|
requirements:
|
129
227
|
- - ! '>='
|
@@ -131,10 +229,15 @@ dependencies:
|
|
131
229
|
version: '0'
|
132
230
|
type: :development
|
133
231
|
prerelease: false
|
134
|
-
version_requirements:
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
none: false
|
234
|
+
requirements:
|
235
|
+
- - ! '>='
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: '0'
|
135
238
|
- !ruby/object:Gem::Dependency
|
136
239
|
name: equivalent-xml
|
137
|
-
requirement:
|
240
|
+
requirement: !ruby/object:Gem::Requirement
|
138
241
|
none: false
|
139
242
|
requirements:
|
140
243
|
- - ! '>='
|
@@ -142,10 +245,47 @@ dependencies:
|
|
142
245
|
version: '0'
|
143
246
|
type: :development
|
144
247
|
prerelease: false
|
145
|
-
version_requirements:
|
248
|
+
version_requirements: !ruby/object:Gem::Requirement
|
249
|
+
none: false
|
250
|
+
requirements:
|
251
|
+
- - ! '>='
|
252
|
+
- !ruby/object:Gem::Version
|
253
|
+
version: '0'
|
146
254
|
- !ruby/object:Gem::Dependency
|
147
255
|
name: jettywrapper
|
148
|
-
requirement:
|
256
|
+
requirement: !ruby/object:Gem::Requirement
|
257
|
+
none: false
|
258
|
+
requirements:
|
259
|
+
- - ! '>='
|
260
|
+
- !ruby/object:Gem::Version
|
261
|
+
version: '0'
|
262
|
+
type: :development
|
263
|
+
prerelease: false
|
264
|
+
version_requirements: !ruby/object:Gem::Requirement
|
265
|
+
none: false
|
266
|
+
requirements:
|
267
|
+
- - ! '>='
|
268
|
+
- !ruby/object:Gem::Version
|
269
|
+
version: '0'
|
270
|
+
- !ruby/object:Gem::Dependency
|
271
|
+
name: pry
|
272
|
+
requirement: !ruby/object:Gem::Requirement
|
273
|
+
none: false
|
274
|
+
requirements:
|
275
|
+
- - ! '>='
|
276
|
+
- !ruby/object:Gem::Version
|
277
|
+
version: '0'
|
278
|
+
type: :development
|
279
|
+
prerelease: false
|
280
|
+
version_requirements: !ruby/object:Gem::Requirement
|
281
|
+
none: false
|
282
|
+
requirements:
|
283
|
+
- - ! '>='
|
284
|
+
- !ruby/object:Gem::Version
|
285
|
+
version: '0'
|
286
|
+
- !ruby/object:Gem::Dependency
|
287
|
+
name: debugger
|
288
|
+
requirement: !ruby/object:Gem::Requirement
|
149
289
|
none: false
|
150
290
|
requirements:
|
151
291
|
- - ! '>='
|
@@ -153,7 +293,12 @@ dependencies:
|
|
153
293
|
version: '0'
|
154
294
|
type: :development
|
155
295
|
prerelease: false
|
156
|
-
version_requirements:
|
296
|
+
version_requirements: !ruby/object:Gem::Requirement
|
297
|
+
none: false
|
298
|
+
requirements:
|
299
|
+
- - ! '>='
|
300
|
+
- !ruby/object:Gem::Version
|
301
|
+
version: '0'
|
157
302
|
description: ! 'GeoServer REST API Ruby library : Requires GeoServer 2.1.3+'
|
158
303
|
email:
|
159
304
|
- renzo.sanchez.silva@gmail.com
|
@@ -162,6 +307,7 @@ extensions: []
|
|
162
307
|
extra_rdoc_files: []
|
163
308
|
files:
|
164
309
|
- .gitignore
|
310
|
+
- .rspec
|
165
311
|
- .travis.yml
|
166
312
|
- Gemfile
|
167
313
|
- README.rdoc
|
@@ -186,6 +332,8 @@ files:
|
|
186
332
|
- lib/rgeoserver/resource.rb
|
187
333
|
- lib/rgeoserver/rest_api_client.rb
|
188
334
|
- lib/rgeoserver/style.rb
|
335
|
+
- lib/rgeoserver/utils/boundingbox.rb
|
336
|
+
- lib/rgeoserver/utils/shapefile_info.rb
|
189
337
|
- lib/rgeoserver/version.rb
|
190
338
|
- lib/rgeoserver/wmsstore.rb
|
191
339
|
- lib/rgeoserver/workspace.rb
|
@@ -196,6 +344,7 @@ files:
|
|
196
344
|
- spec/fixtures/datasets/vector/granules.qix
|
197
345
|
- spec/fixtures/datasets/vector/granules.shp
|
198
346
|
- spec/fixtures/datasets/vector/granules.shx
|
347
|
+
- spec/fixtures/datasets/vector/granules.zip
|
199
348
|
- spec/fixtures/resources/coveragestore/coveragestores.xml
|
200
349
|
- spec/fixtures/resources/coveragestore/old.xml
|
201
350
|
- spec/fixtures/resources/coveragestore/old_coverages.xml
|
@@ -208,6 +357,8 @@ files:
|
|
208
357
|
- spec/functional/resource_spec.rb
|
209
358
|
- spec/integration/geoserver_spec.rb
|
210
359
|
- spec/spec_helper.rb
|
360
|
+
- spec/utils/boundingbox_spec.rb
|
361
|
+
- spec/utils/shapefile_info_spec.rb
|
211
362
|
homepage: http://github.com/rnz0/rgeoserver
|
212
363
|
licenses: []
|
213
364
|
post_install_message:
|
@@ -228,7 +379,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
379
|
version: '0'
|
229
380
|
requirements: []
|
230
381
|
rubyforge_project:
|
231
|
-
rubygems_version: 1.8.
|
382
|
+
rubygems_version: 1.8.25
|
232
383
|
signing_key:
|
233
384
|
specification_version: 3
|
234
385
|
summary: GeoServer REST API ruby library
|
@@ -243,6 +394,7 @@ test_files:
|
|
243
394
|
- spec/fixtures/datasets/vector/granules.qix
|
244
395
|
- spec/fixtures/datasets/vector/granules.shp
|
245
396
|
- spec/fixtures/datasets/vector/granules.shx
|
397
|
+
- spec/fixtures/datasets/vector/granules.zip
|
246
398
|
- spec/fixtures/resources/coveragestore/coveragestores.xml
|
247
399
|
- spec/fixtures/resources/coveragestore/old.xml
|
248
400
|
- spec/fixtures/resources/coveragestore/old_coverages.xml
|
@@ -255,4 +407,6 @@ test_files:
|
|
255
407
|
- spec/functional/resource_spec.rb
|
256
408
|
- spec/integration/geoserver_spec.rb
|
257
409
|
- spec/spec_helper.rb
|
410
|
+
- spec/utils/boundingbox_spec.rb
|
411
|
+
- spec/utils/shapefile_info_spec.rb
|
258
412
|
has_rdoc:
|