geotree 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.txt +4 -2
- data/README.txt +6 -8
- data/lib/geotree/blockfile.rb +0 -28
- data/lib/geotree/geotree.rb +55 -119
- data/lib/geotree/multitree.rb +2 -21
- data/lib/geotree/pswriter.rb +217 -150
- data/lib/geotree/tools.rb +1 -0
- data/test/test_blockfile.rb +1 -1
- data/test/test_externalsort.rb +15 -1
- data/test/test_geotree.rb +24 -7
- data/test/test_ps.rb +1 -1
- metadata +2 -5
- data/lib/fig/geo_tree.pdf +0 -0
- data/lib/fig/multi_tree.pdf +0 -0
data/lib/geotree/tools.rb
CHANGED
data/test/test_blockfile.rb
CHANGED
data/test/test_externalsort.rb
CHANGED
@@ -25,7 +25,21 @@ class TestExternalSort < MyTestSuite
|
|
25
25
|
@@test_dir = "workdir"
|
26
26
|
mkdir(@@test_dir)
|
27
27
|
|
28
|
-
@@path = File.join(@@test_dir,"_input_.
|
28
|
+
@@path = File.join(@@test_dir,"_input_.txt")
|
29
|
+
if !File.file?(@@path)
|
30
|
+
pr("\nConstructing test file #{@@path}...\n")
|
31
|
+
srand(42)
|
32
|
+
q = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')
|
33
|
+
|
34
|
+
s = ''
|
35
|
+
while s.size < 100000
|
36
|
+
m = q.shuffle
|
37
|
+
m = m[0..rand(q.size)]
|
38
|
+
s << m.join << "\n"
|
39
|
+
end
|
40
|
+
write_text_file(@@path,s)
|
41
|
+
end
|
42
|
+
|
29
43
|
raise Exception,"no test file found" if !File.file?(@@path)
|
30
44
|
|
31
45
|
@@path3 = File.join(@@test_dir,"_largefile_.dat")
|
data/test/test_geotree.rb
CHANGED
@@ -218,7 +218,7 @@ class TestGeoTree < MyTestSuite
|
|
218
218
|
|
219
219
|
def test_buffering
|
220
220
|
db = false
|
221
|
-
# db = true
|
221
|
+
# db = true
|
222
222
|
|
223
223
|
return if !db
|
224
224
|
|
@@ -341,8 +341,9 @@ class TestGeoTree < MyTestSuite
|
|
341
341
|
|
342
342
|
tree = GeoTree.new
|
343
343
|
ps1 = prepare_tree(tree)
|
344
|
-
w = prepare_ws("
|
345
|
-
|
344
|
+
w = prepare_ws("geo_tree.ps")
|
345
|
+
|
346
|
+
bgnd = nil
|
346
347
|
|
347
348
|
50.times do |i|
|
348
349
|
w.new_page("GeoTree")
|
@@ -356,15 +357,23 @@ class TestGeoTree < MyTestSuite
|
|
356
357
|
|
357
358
|
width = (200 * (20+i)) / 25
|
358
359
|
height = (width * 2)/3
|
360
|
+
|
359
361
|
r = Bounds.new(x-width/2,y-height/2,width,height)
|
360
362
|
pts = tree.find(r)
|
361
363
|
w.push(w.set_gray(0))
|
362
364
|
w.draw_rect(r.x,r.y,r.w,r.h )
|
363
365
|
w.pop
|
364
366
|
|
365
|
-
|
366
|
-
|
367
|
-
|
367
|
+
if !bgnd
|
368
|
+
w.start_buffer
|
369
|
+
|
370
|
+
w.push(w.set_rgb(0.4,0.4,0.9))
|
371
|
+
plot_pts_colored(w,ps1)
|
372
|
+
w.pop
|
373
|
+
bgnd = w.stop_buffer
|
374
|
+
w.add_element('bgnd',bgnd)
|
375
|
+
end
|
376
|
+
w.draw_element('bgnd')
|
368
377
|
|
369
378
|
w.push(w.set_rgb(0.75,0,0))
|
370
379
|
plot_pts_colored(w,pts,1.5)
|
@@ -386,6 +395,8 @@ class TestGeoTree < MyTestSuite
|
|
386
395
|
|
387
396
|
ps1 = nil
|
388
397
|
|
398
|
+
bgnd = nil
|
399
|
+
|
389
400
|
[0,1].each do |pass|
|
390
401
|
|
391
402
|
if pass == 0
|
@@ -416,7 +427,13 @@ class TestGeoTree < MyTestSuite
|
|
416
427
|
w.draw_rect(r.x,r.y,r.w,r.h )
|
417
428
|
w.pop
|
418
429
|
|
419
|
-
|
430
|
+
if !bgnd
|
431
|
+
w.start_buffer
|
432
|
+
plot_pts(w,ps1,0.8)
|
433
|
+
bgnd = w.stop_buffer
|
434
|
+
w.add_element('bgnd',bgnd)
|
435
|
+
end
|
436
|
+
w.draw_element('bgnd')
|
420
437
|
|
421
438
|
w.push(w.set_rgb(0.75,0,0))
|
422
439
|
plot_pts_colored(w,pts,1.2)
|
data/test/test_ps.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geotree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Sember
|
@@ -17,8 +17,7 @@ description: " \nA GeoTree is a variant of a k-d tree, and stores data points
|
|
17
17
|
trees can be constructed instead.\n\nThe gem includes MultiTree, a GeoTree variant
|
18
18
|
that supports queries at \nmultiple levels of detail. For example, when focusing
|
19
19
|
on a \nsmall region it can return points that would be omitted when querying a much
|
20
|
-
larger region.\n\
|
21
|
-
be found in the doc directory.\n\n"
|
20
|
+
larger region.\n\n"
|
22
21
|
email: jpsember@gmail.com
|
23
22
|
executables: []
|
24
23
|
extensions: []
|
@@ -37,8 +36,6 @@ files:
|
|
37
36
|
- lib/geotree/pswriter.rb
|
38
37
|
- lib/geotree/ptbuffer.rb
|
39
38
|
- lib/geotree/tools.rb
|
40
|
-
- lib/fig/geo_tree.pdf
|
41
|
-
- lib/fig/multi_tree.pdf
|
42
39
|
- CHANGELOG.txt
|
43
40
|
- README.txt
|
44
41
|
- test/test_blockfile.rb
|
data/lib/fig/geo_tree.pdf
DELETED
Binary file
|
data/lib/fig/multi_tree.pdf
DELETED
Binary file
|