librtree 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rtree/rtree.c +3 -0
  3. data/lib/rtree.rb +9 -6
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9abe4061328dd6a2b8b9f1c00a38f76332a0f0a188af7a5d3e6f1125eab346e
4
- data.tar.gz: 4029ed06803576cc76ec7bd8d3d1eb9a2d628da9fd982d04e80b643177fce244
3
+ metadata.gz: ad62e4e446f6fb4571d33f6498bf9df26d5b360a0325cde40ead187ebcb0be04
4
+ data.tar.gz: d462f690013c36933961206659026af7fe9b50ea6d23198f15a0965247390192
5
5
  SHA512:
6
- metadata.gz: f6b7005f8ec37a45ff8ee894de5642eb969a26af72ad9fa330aeeae1c746447d786b309301e84116de595bed40f70bef8683fbd9a969b2b9c2cabb32e5c4d374
7
- data.tar.gz: c4c6641e2cdfd9f14f21b50047fe2f304ab1446eb643a0f6cd3acd594fbc37469cf71c78434daa82b759bdb2741a1f887add7809d72c7bbc3f39886aee3ecc9b
6
+ metadata.gz: 19e997efe8519f2db02e10f69f8d60af57c376e9a6de7f38bc8f3613cbd8287800e096816f1c37361c122c0a7c99e41bd97f7842ddebdf0357395e31a666739b
7
+ data.tar.gz: bf1911bade3fcba763aee1f4a451dd9638f8e9c3b06577482b09bc134942282d031538d8a436ee161ec4334c7f2dfdadfcf8ac1349dc3d32b053c69390e5eb7f
data/ext/rtree/rtree.c CHANGED
@@ -422,4 +422,7 @@ void Init_rtree(void)
422
422
  rb_define_singleton_method(cls, "json_read", lrt_json_read, 1);
423
423
  rb_define_singleton_method(cls, "bsrt_read", lrt_bsrt_read, 1);
424
424
  rb_define_singleton_method(cls, "csv_read", lrt_csv_read, 3);
425
+ rb_define_const(cls, "SPLIT_QUADRATIC", INT2NUM(RTREE_SPLIT_QUADRATIC));
426
+ rb_define_const(cls, "SPLIT_LINEAR", INT2NUM(RTREE_SPLIT_LINEAR));
427
+ rb_define_const(cls, "SPLIT_GREENE", INT2NUM(RTREE_SPLIT_GREENE));
425
428
  }
data/lib/rtree.rb CHANGED
@@ -96,7 +96,7 @@ class RTree < RTreeC
96
96
  # Build a new RTree instance from CSV stream
97
97
  # @param io [IO] a readable stream object
98
98
  # @param dim [Integer] the dimension of the tree
99
- # @param split [:linear, :quadratic] See {#initialize}
99
+ # @param split [:linear, :quadratic, :greene] See {#initialize}
100
100
  # @param node_page [Integer] See {#initialize}
101
101
  # @return [RTree] the newly built RTree
102
102
  # @note The CSV file (without header) should have the id in the
@@ -139,9 +139,11 @@ class RTree < RTreeC
139
139
  def split_flag(split)
140
140
  case split
141
141
  when :quadratic
142
- 0
142
+ self::SPLIT_QUADRATIC
143
143
  when :linear
144
- 1
144
+ self::SPLIT_LINEAR
145
+ when :greene
146
+ self::SPLIT_GREENE
145
147
  else
146
148
  raise ArgumentError, "bad split value: #{split}"
147
149
  end
@@ -180,9 +182,10 @@ class RTree < RTreeC
180
182
 
181
183
  # Initialize a new (empty) RTree
182
184
  # @param dim [Integer] the dimension of the tree
183
- # @param split [:linear, :quadratic] determines the splitting strategy,
184
- # the linear strategy is faster to build, the quadratic produces a
185
- # better-quality R-tree which is faster to query.
185
+ # @param split [:linear, :quadratic, :greene] determines the splitting
186
+ # strategy, the linear strategy is faster to build, the quadratic
187
+ # and greene strategies produces a better-quality R-trees which is
188
+ # faster to query.
186
189
  # @param node_page [Integer] the nodes-per-page value. This value can
187
190
  # affect performance quite dramatically, particularly build time. A
188
191
  # value which is too large would result in an infeasible branching
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librtree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.J. Green
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-13 00:00:00.000000000 Z
11
+ date: 2021-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements:
129
- - The librtree library (1.0.5 or later)
129
+ - The librtree library (1.0.6 or later)
130
130
  rubygems_version: 3.1.2
131
131
  signing_key:
132
132
  specification_version: 4