File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,11 @@ limitations under the License.
1717package hilbert
1818
1919import (
20- "log"
2120 "sort"
2221
2322 "github.com/Workiva/go-datastructures/rtree"
2423)
2524
26- func init () {
27- log .Printf (`I HATE THIS.` )
28- }
29-
3025type hilbert int64
3126
3227type hilberts []hilbert
Original file line number Diff line number Diff line change @@ -424,3 +424,8 @@ func newTree(bufferSize, ary uint64) *tree {
424424 tree .init (bufferSize , ary )
425425 return tree
426426}
427+
428+ // New will construct a new Hilbert R-Tree and return it.
429+ func New (bufferSize , ary uint64 ) rtree.RTree {
430+ return newTree (bufferSize , ary )
431+ }
Original file line number Diff line number Diff line change @@ -26,3 +26,19 @@ type Rectangle interface {
2626 // UpperRight describes the upper right coordinate of this rectangle.
2727 UpperRight () (int32 , int32 )
2828}
29+
30+ // RTree defines an object that can be returned from any subpackage
31+ // of this package.
32+ type RTree interface {
33+ // Search will perform an intersection search of the given
34+ // rectangle and return any rectangles that intersect.
35+ Search (Rectangle ) Rectangles
36+ // Len returns in the number of items in the RTree.
37+ Len () uint64
38+ // Dispose will clean up any objects used by the RTree.
39+ Dispose ()
40+ // Delete will remove the provided rectangles from the RTree.
41+ Delete (... Rectangle )
42+ // Insert will add the provided rectangles to the RTree.
43+ Insert (... Rectangle )
44+ }
You can’t perform that action at this time.
0 commit comments