librtree 1.0.6 → 1.0.7
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 +4 -4
- data/CHANGELOG.md +7 -2
- data/README.md +1 -1
- data/ext/rtree/lib/branches.c +1 -1
- data/ext/rtree/lib/bsrt.c +1 -1
- data/ext/rtree/lib/error.c +25 -26
- data/ext/rtree/lib/node.c +3 -3
- data/ext/rtree/lib/package.c +1 -1
- data/ext/rtree/lib/split.c +1 -1
- data/lib/rtree.rb +8 -8
- metadata +39 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a28182f3e87b5fb00cbf5efea523d8c43bd02ed774261998b8d5b31ee6c90c0
|
|
4
|
+
data.tar.gz: 4fa0cd3c75e9bd942aca77085aed0f033bb3de7ef57cca79a742a43458207070
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 947f0fcb19e4a7882b2e9d3bafdb4f4d20a85bbdd2d3e8e7245e584d2381400ac77d19f0a81b12e5b85c5cbcf36a52e7c7a948c320e6482af7ec4b01c32508d3
|
|
7
|
+
data.tar.gz: c0025ab24f0c93095e46d36a74bab89254a498c5da02928aa5341b80c94d362f30cca6677172cd5fc26f988291ce25b053552f3fbc123cc727a0db31c6efb660
|
data/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
---------
|
|
3
3
|
|
|
4
|
+
### 1.0.7, 20-01-2026
|
|
5
|
+
|
|
6
|
+
- Spelling
|
|
7
|
+
- Tested on Ruby 3.4, 4.0
|
|
8
|
+
|
|
4
9
|
### 1.0.6, 07-04-2024
|
|
5
10
|
|
|
6
|
-
- Update to librtree 1.3.
|
|
11
|
+
- Update to librtree 1.3.2
|
|
7
12
|
- Adds `#envelope` `#csv_write`, `#to_csv`
|
|
8
13
|
|
|
9
14
|
### 1.0.5, 16-01-2024
|
|
@@ -62,7 +67,7 @@ Changelog
|
|
|
62
67
|
### 0.8.8, 14-07-2021
|
|
63
68
|
|
|
64
69
|
- De-nest C base-class for neater documentation
|
|
65
|
-
- Adopt "standard" naming-convention for the
|
|
70
|
+
- Adopt "standard" naming-convention for the benefit of Yard
|
|
66
71
|
introspection
|
|
67
72
|
- No functional changes
|
|
68
73
|
|
data/README.md
CHANGED
|
@@ -83,6 +83,6 @@ run the tests:
|
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
[1]: http://www.digip.org/jansson/
|
|
86
|
-
[3]:
|
|
86
|
+
[3]: https://jjg.gitlab.io/en/code/librtree/
|
|
87
87
|
[4]: https://github.com/rbenv/rbenv
|
|
88
88
|
[5]: https://www.rubydoc.info/gems/librtree/RTree
|
data/ext/rtree/lib/branches.c
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
The code here is to handle a void* buffer as an array of branch,
|
|
3
3
|
we can't actually create an array of branch since its size is
|
|
4
4
|
not known until runtime, so we have to perform those calculations
|
|
5
|
-
ourselves. Note that we just do the
|
|
5
|
+
ourselves. Note that we just do the arithmetic here, no error
|
|
6
6
|
checking -- so a over-sized index to branches_get() will lead to
|
|
7
7
|
a memory error, the caller is expected to do this check themselves
|
|
8
8
|
*/
|
data/ext/rtree/lib/bsrt.c
CHANGED
|
@@ -108,7 +108,7 @@ static int write_id(rtree_id_t id, FILE *stream)
|
|
|
108
108
|
byte-order is big-endian, this saves time on little-endian
|
|
109
109
|
hardware. Note that in the big-endian case, we call htole32()
|
|
110
110
|
which converts from the host integer byte-order to little-endian,
|
|
111
|
-
this will only be correct if integer and float
|
|
111
|
+
this will only be correct if integer and float endianness are
|
|
112
112
|
the same, this is not true in general (!), there exists real
|
|
113
113
|
hardware with big-endian floats and little-endian integers.
|
|
114
114
|
So it would be better to use be32tole32() here, but that does
|
data/ext/rtree/lib/error.c
CHANGED
|
@@ -13,32 +13,31 @@ const char* strerror_rtree(int err)
|
|
|
13
13
|
{
|
|
14
14
|
int err;
|
|
15
15
|
const char *msg;
|
|
16
|
-
} *m, mtab[] =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
16
|
+
} *m, mtab[] = {
|
|
17
|
+
{ RTREE_OK, "Success" },
|
|
18
|
+
{ RTREE_ERR_INVAL, "Invalid argument" },
|
|
19
|
+
{ RTREE_ERR_DOM, "Argument outside domain" },
|
|
20
|
+
{ RTREE_ERR_NOMEM, "Out of memory" },
|
|
21
|
+
{ RTREE_ERR_CSVPARSE, "Error parsing CSV" },
|
|
22
|
+
{ RTREE_ERR_NOCSV, "Compiled without CSV support" },
|
|
23
|
+
{ RTREE_ERR_JANSSON, "Error from the Jansson library" },
|
|
24
|
+
{ RTREE_ERR_NOJSON, "Compiled without JSON support" },
|
|
25
|
+
{ RTREE_ERR_NOBSRT, "Compiled without BSRT support" },
|
|
26
|
+
{ RTREE_ERR_GETBRANCH, "Error getting branch" },
|
|
27
|
+
{ RTREE_ERR_GETCHILD, "Error getting child node" },
|
|
28
|
+
{ RTREE_ERR_NODECLONE, "Error cloning node" },
|
|
29
|
+
{ RTREE_ERR_PICKBRANCH, "Error picking branch" },
|
|
30
|
+
{ RTREE_ERR_ADDRECT, "Error adding rectangle" },
|
|
31
|
+
{ RTREE_ERR_NOSUCHSPLIT, "No such splitting method" },
|
|
32
|
+
{ RTREE_ERR_DIMS, "Bad R-tree dimension" },
|
|
33
|
+
{ RTREE_ERR_EMPTY, "Empty R-tree" },
|
|
34
|
+
{ RTREE_ERR_BUFFER, "Buffer too small" },
|
|
35
|
+
{ RTREE_ERR_POSTSCRIPT, "Error generating PostScript" },
|
|
36
|
+
{ RTREE_ERR_USER, "User abort" },
|
|
37
|
+
{ RTREE_ERR_FWRITE, "Failed write" },
|
|
38
|
+
{ RTREE_ERR_SPLIT, "Error in split" },
|
|
39
|
+
{ -1, NULL }
|
|
40
|
+
};
|
|
42
41
|
|
|
43
42
|
for (m = mtab ; m->msg ; m++)
|
|
44
43
|
if (m->err == err) return m->msg;
|
data/ext/rtree/lib/node.c
CHANGED
|
@@ -282,8 +282,8 @@ static node_t* node_split(const state_t *state, node_t *node, branch_t *branch)
|
|
|
282
282
|
|
|
283
283
|
/*
|
|
284
284
|
add branch to node, which may split the node: if so the new node
|
|
285
|
-
|
|
286
|
-
value is the way to detect that splitting has
|
|
285
|
+
argument is returned, so comparing the node argument and return
|
|
286
|
+
value is the way to detect that splitting has occurred.
|
|
287
287
|
*/
|
|
288
288
|
|
|
289
289
|
node_t* node_add_branch(const state_t *state, node_t *node, branch_t *branch)
|
|
@@ -306,7 +306,7 @@ node_t* node_add_branch(const state_t *state, node_t *node, branch_t *branch)
|
|
|
306
306
|
|
|
307
307
|
/*
|
|
308
308
|
Pick a branch. Pick the one that will need the smallest increase
|
|
309
|
-
in volume to
|
|
309
|
+
in volume to accommodate the new (hyper-)rectangle. This will result
|
|
310
310
|
in the least total volume for the covering rectangles in the current
|
|
311
311
|
node.
|
|
312
312
|
|
data/ext/rtree/lib/package.c
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
#include "rtree/package.h"
|
|
7
7
|
|
|
8
|
-
const char rtree_package_version[] = "1.3.
|
|
8
|
+
const char rtree_package_version[] = "1.3.2";
|
|
9
9
|
const char rtree_package_name[] = "librtree";
|
|
10
10
|
const char rtree_package_url[] = "https://gitlab.com/jjg/librtree";
|
|
11
11
|
const char rtree_package_bugreport[] = "j.j.green@gmx.co.uk";
|
data/ext/rtree/lib/split.c
CHANGED
|
@@ -143,7 +143,7 @@ static int split_seed_linear(const state_t *state, split_t *split)
|
|
|
143
143
|
/*
|
|
144
144
|
Picks two rectangles to be the first (seed) elements of the
|
|
145
145
|
partition groups. They are the two that waste the most area
|
|
146
|
-
if
|
|
146
|
+
if covered by a single rectangle.
|
|
147
147
|
|
|
148
148
|
Note that this is as implemented in the Guttman-Green version
|
|
149
149
|
quadratic splitting, but is quadratic only in the page-size,
|
data/lib/rtree.rb
CHANGED
|
@@ -16,7 +16,7 @@ require 'fcntl'
|
|
|
16
16
|
#
|
|
17
17
|
# A Ruby native extension implementing the R-tree spatial index of
|
|
18
18
|
# Guttman-Green. The code is an embedded version of
|
|
19
|
-
# {
|
|
19
|
+
# {https://jjg.gitlab.io/en/code/librtree librtree}.
|
|
20
20
|
#
|
|
21
21
|
# Use
|
|
22
22
|
#
|
|
@@ -346,7 +346,7 @@ class RTree < RTreeBase
|
|
|
346
346
|
if block_given? then
|
|
347
347
|
super
|
|
348
348
|
else
|
|
349
|
-
ids = []
|
|
349
|
+
ids = [] #: Array[Integer]
|
|
350
350
|
super(coords) { |id| ids << id }
|
|
351
351
|
ids
|
|
352
352
|
end
|
|
@@ -482,10 +482,10 @@ class RTree < RTreeBase
|
|
|
482
482
|
super
|
|
483
483
|
end
|
|
484
484
|
|
|
485
|
-
#
|
|
486
|
-
#
|
|
487
|
-
#
|
|
488
|
-
#
|
|
485
|
+
# The bounding rectangle (in the same format as the rectangle
|
|
486
|
+
# input) for all rectangles in the tree. In the case that the
|
|
487
|
+
# input is empty, returns nil.
|
|
488
|
+
# @return [Array<Float>] the bounding rectangle
|
|
489
489
|
#
|
|
490
490
|
def envelope
|
|
491
491
|
super
|
|
@@ -627,11 +627,11 @@ class RTree::Style < RTreeStyleBase
|
|
|
627
627
|
# ]
|
|
628
628
|
# )
|
|
629
629
|
#
|
|
630
|
-
def
|
|
630
|
+
def from_array(array)
|
|
631
631
|
from_json(array.to_json)
|
|
632
632
|
end
|
|
633
633
|
|
|
634
|
-
alias_method :
|
|
634
|
+
alias_method :from_a, :from_array
|
|
635
635
|
|
|
636
636
|
private
|
|
637
637
|
|
metadata
CHANGED
|
@@ -1,139 +1,153 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: librtree
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- J.J. Green
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '2.1'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - "
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '2.1'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '13.0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '13.0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rspec
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '3.10'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - "
|
|
52
|
+
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '3.10'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: simplecov
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- - "
|
|
59
|
+
- - ">="
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: '0.22'
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- - "
|
|
66
|
+
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0.22'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: yard
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- - "
|
|
73
|
+
- - ">="
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
75
|
version: '0.9'
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- - "
|
|
80
|
+
- - ">="
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '0.9'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: rubygems-tasks
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- - "
|
|
87
|
+
- - ">="
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
89
|
version: '0.2'
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- - "
|
|
94
|
+
- - ">="
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0.2'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: ostruct
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0.6'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0.6'
|
|
97
111
|
- !ruby/object:Gem::Dependency
|
|
98
112
|
name: rake-compiler
|
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
|
100
114
|
requirements:
|
|
101
|
-
- - "
|
|
115
|
+
- - ">="
|
|
102
116
|
- !ruby/object:Gem::Version
|
|
103
117
|
version: '1.1'
|
|
104
118
|
type: :development
|
|
105
119
|
prerelease: false
|
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
121
|
requirements:
|
|
108
|
-
- - "
|
|
122
|
+
- - ">="
|
|
109
123
|
- !ruby/object:Gem::Version
|
|
110
124
|
version: '1.1'
|
|
111
125
|
- !ruby/object:Gem::Dependency
|
|
112
126
|
name: steep
|
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
|
114
128
|
requirements:
|
|
115
|
-
- - "
|
|
129
|
+
- - ">="
|
|
116
130
|
- !ruby/object:Gem::Version
|
|
117
131
|
version: '1.4'
|
|
118
132
|
type: :development
|
|
119
133
|
prerelease: false
|
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
135
|
requirements:
|
|
122
|
-
- - "
|
|
136
|
+
- - ">="
|
|
123
137
|
- !ruby/object:Gem::Version
|
|
124
138
|
version: '1.4'
|
|
125
139
|
- !ruby/object:Gem::Dependency
|
|
126
140
|
name: rbs
|
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
|
128
142
|
requirements:
|
|
129
|
-
- - "
|
|
143
|
+
- - ">="
|
|
130
144
|
- !ruby/object:Gem::Version
|
|
131
145
|
version: '3.2'
|
|
132
146
|
type: :development
|
|
133
147
|
prerelease: false
|
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
149
|
requirements:
|
|
136
|
-
- - "
|
|
150
|
+
- - ">="
|
|
137
151
|
- !ruby/object:Gem::Version
|
|
138
152
|
version: '3.2'
|
|
139
153
|
description: |
|
|
@@ -205,7 +219,7 @@ homepage: https://gitlab.com/jjg/librtree-ruby
|
|
|
205
219
|
licenses:
|
|
206
220
|
- MIT
|
|
207
221
|
metadata: {}
|
|
208
|
-
post_install_message:
|
|
222
|
+
post_install_message:
|
|
209
223
|
rdoc_options: []
|
|
210
224
|
require_paths:
|
|
211
225
|
- lib
|
|
@@ -214,7 +228,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
214
228
|
requirements:
|
|
215
229
|
- - ">="
|
|
216
230
|
- !ruby/object:Gem::Version
|
|
217
|
-
version: '
|
|
231
|
+
version: '3.0'
|
|
218
232
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
233
|
requirements:
|
|
220
234
|
- - ">="
|
|
@@ -222,8 +236,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
222
236
|
version: '0'
|
|
223
237
|
requirements:
|
|
224
238
|
- The Jansson library
|
|
225
|
-
rubygems_version: 3.
|
|
226
|
-
signing_key:
|
|
239
|
+
rubygems_version: 3.5.11
|
|
240
|
+
signing_key:
|
|
227
241
|
specification_version: 4
|
|
228
242
|
summary: R-tree spatial index
|
|
229
243
|
test_files: []
|