geotree 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.txt +3 -0
- data/README.txt +6 -0
- data/lib/geotree.rb +1 -0
- data/lib/geotree/blockfile.rb +453 -0
- data/lib/geotree/bounds.rb +81 -0
- data/lib/geotree/datapoint.rb +68 -0
- data/lib/geotree/diskblockfile.rb +64 -0
- data/lib/geotree/externalsort.rb +369 -0
- data/lib/geotree/geotree.rb +980 -0
- data/lib/geotree/loc.rb +76 -0
- data/lib/geotree/multitree.rb +190 -0
- data/lib/geotree/node.rb +252 -0
- data/lib/geotree/pswriter.rb +471 -0
- data/lib/geotree/ptbuffer.rb +120 -0
- data/lib/geotree/tools.rb +626 -0
- data/test/test_blockfile.rb +153 -0
- data/test/test_externalsort.rb +139 -0
- data/test/test_geotree.rb +432 -0
- data/test/test_ps.rb +56 -0
- metadata +76 -0
data/test/test_ps.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
require_relative '../lib/geotree/tools.rb'
|
4
|
+
req('pswriter')
|
5
|
+
|
6
|
+
|
7
|
+
#SINGLETEST = "test_xxx..."
|
8
|
+
if defined? SINGLETEST
|
9
|
+
if main?(__FILE__)
|
10
|
+
ARGV.concat("-n #{SINGLETEST}".split)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class TestBlockFile < Test::Unit::TestCase #< MyTestSuite
|
15
|
+
|
16
|
+
# --------------- tests --------------------------
|
17
|
+
|
18
|
+
def test_100_create_poscript_file
|
19
|
+
|
20
|
+
poly = [ 0, 0, 50, 30, 30, 80]
|
21
|
+
|
22
|
+
w = PSWriter.new("test/workdir/__test__.ps")
|
23
|
+
|
24
|
+
w.set_logical_page_size(1000, 1000)
|
25
|
+
10.times do |i|
|
26
|
+
|
27
|
+
w.new_page("example page #{i}" )
|
28
|
+
|
29
|
+
w.draw_disc(200, 700, 200 - i * 18)
|
30
|
+
w.draw_circle(700, 220, 10 + i * 5);
|
31
|
+
|
32
|
+
w.push(w.set_gray(0.8));
|
33
|
+
w.draw_disc(500, 500, 30 + i * 10);
|
34
|
+
w.pop();
|
35
|
+
w.push(w.set_line_width(3));
|
36
|
+
w.push(w.set_line_dashed());
|
37
|
+
w.draw_circle(500, 500, 30 + i * 10);
|
38
|
+
w.pop(2);
|
39
|
+
|
40
|
+
w.draw_line(20 + i * 10, 20, 980, 500 + i * 48);
|
41
|
+
w.push(w.set_line_width(1.2 + 0.3 * i));
|
42
|
+
w.push(w.translate(500 - i * 40, 500 - i * 40));
|
43
|
+
w.push(w.set_scale(1 + i * 0.7));
|
44
|
+
w.draw_polygon(poly, 0, 0);
|
45
|
+
w.pop(3);
|
46
|
+
|
47
|
+
w.push(w.set_rgb(1, 0.2, 0.2));
|
48
|
+
w.push(w.set_font_size(10 + i * 3));
|
49
|
+
w.draw_string("Hello", 10 + i * 30, 900 - i * 40);
|
50
|
+
w.pop();
|
51
|
+
w.pop();
|
52
|
+
end
|
53
|
+
w.close();
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: geotree
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jeff Sember
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-04-01 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: " \nA GeoTree is a variant of a k-d tree, and stores data points that
|
14
|
+
have a latitude and longitude, \na unique integer identifier, and an optional 'weight'
|
15
|
+
(e.g., the size of a city). \nGeoTrees are disk-based data structures and can store
|
16
|
+
a very large number of points efficiently.\nIf desired, for smaller data sets, memory-only
|
17
|
+
trees can be constructed instead.\n\nThe gem includes MultiTrees, a GeoTree variant
|
18
|
+
that supports queries at \nmultiple levels of detail. For example, when focusing
|
19
|
+
on a \nsmall region it can return points that would be omitted when querying a much
|
20
|
+
larger region.\n\nAnimations illustrating GeoTrees and MultiTrees in action can
|
21
|
+
be found in the doc directory.\n\n"
|
22
|
+
email: jpsember@gmail.com
|
23
|
+
executables: []
|
24
|
+
extensions: []
|
25
|
+
extra_rdoc_files: []
|
26
|
+
files:
|
27
|
+
- lib/geotree.rb
|
28
|
+
- lib/geotree/blockfile.rb
|
29
|
+
- lib/geotree/bounds.rb
|
30
|
+
- lib/geotree/datapoint.rb
|
31
|
+
- lib/geotree/diskblockfile.rb
|
32
|
+
- lib/geotree/externalsort.rb
|
33
|
+
- lib/geotree/geotree.rb
|
34
|
+
- lib/geotree/loc.rb
|
35
|
+
- lib/geotree/multitree.rb
|
36
|
+
- lib/geotree/node.rb
|
37
|
+
- lib/geotree/pswriter.rb
|
38
|
+
- lib/geotree/ptbuffer.rb
|
39
|
+
- lib/geotree/tools.rb
|
40
|
+
- CHANGELOG.txt
|
41
|
+
- README.txt
|
42
|
+
- test/test_blockfile.rb
|
43
|
+
- test/test_externalsort.rb
|
44
|
+
- test/test_geotree.rb
|
45
|
+
- test/test_ps.rb
|
46
|
+
homepage: http://www.cs.ubc.ca/~jpsember/
|
47
|
+
licenses:
|
48
|
+
- mit
|
49
|
+
metadata: {}
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options: []
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
requirements: []
|
65
|
+
rubyforge_project:
|
66
|
+
rubygems_version: 2.0.2
|
67
|
+
signing_key:
|
68
|
+
specification_version: 4
|
69
|
+
summary: Maintains sets of geographical points; reports points lying within a query
|
70
|
+
rectangle; supports multiple levels of detail
|
71
|
+
test_files:
|
72
|
+
- test/test_blockfile.rb
|
73
|
+
- test/test_externalsort.rb
|
74
|
+
- test/test_geotree.rb
|
75
|
+
- test/test_ps.rb
|
76
|
+
has_rdoc:
|