From 11b677ad2cb5f7752f595fb1c5de41e319627ad5 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Sat, 11 Jun 2016 17:28:47 -0700 Subject: [PATCH] basic functionality --- LICENSE | 19 +++++++++++++++++++ README.md | 20 ++++++++++++++++++++ rtree_base.go | 3 +-- vendor/d1/rtree.go | 3 +-- vendor/d2/rtree.go | 3 +-- vendor/d3/rtree.go | 3 +-- vendor/d4/rtree.go | 3 +-- 7 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1a6cb67 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2016 Josh Baker + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5bef68b --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +RTree implementation for Go +=========================== + +[![Build Status](https://travis-ci.org/tidwall/rtree.svg?branch=master)](https://travis-ci.org/tidwall/rtree) +[![GoDoc](https://godoc.org/github.com/tidwall/rtree/client?status.svg)](https://godoc.org/github.com/tidwall/rtree/client) + +This package provides an in-memory R-Tree implementation for Go, useful as a spatial data structure. It has support for 1-4 dimensions, and can store and search multidimensions interchangably in the same tree. + +AUTHORS +======= +* 1983 Original algorithm and test code by Antonin Guttman and Michael Stonebraker, UC Berkely +* 1994 ANCI C ported from original test code by Melinda Green +* 1995 Sphere volume fix for degeneracy problem submitted by Paul Brook +* 2004 Templated C++ port by Greg Douglas +* 2016 Go port by Josh Baker + +License +======= +RTree source code is available under the MIT License. + diff --git a/rtree_base.go b/rtree_base.go index 5c64fa3..3e603d5 100644 --- a/rtree_base.go +++ b/rtree_base.go @@ -9,7 +9,6 @@ TITLE DESCRIPTION A Go version of the RTree algorithm. - For more information please read the comments in rtree.go AUTHORS @@ -379,7 +378,7 @@ func DisconnectBranch(node *Node, index int) { // Remove element by swapping with the last element to prevent gaps in array node.branch[index] = node.branch[node.count-1] - + node.branch[node.count-1].data = nil node.count-- } diff --git a/vendor/d1/rtree.go b/vendor/d1/rtree.go index e483f0f..125ea56 100644 --- a/vendor/d1/rtree.go +++ b/vendor/d1/rtree.go @@ -9,7 +9,6 @@ TITLE DESCRIPTION A Go version of the RTree algorithm. - For more information please read the comments in rtree.go AUTHORS @@ -379,7 +378,7 @@ func DisconnectBranch(node *Node, index int) { // Remove element by swapping with the last element to prevent gaps in array node.branch[index] = node.branch[node.count-1] - + node.branch[node.count-1].data = nil node.count-- } diff --git a/vendor/d2/rtree.go b/vendor/d2/rtree.go index b7b3f9d..35ad4ce 100644 --- a/vendor/d2/rtree.go +++ b/vendor/d2/rtree.go @@ -9,7 +9,6 @@ TITLE DESCRIPTION A Go version of the RTree algorithm. - For more information please read the comments in rtree.go AUTHORS @@ -379,7 +378,7 @@ func DisconnectBranch(node *Node, index int) { // Remove element by swapping with the last element to prevent gaps in array node.branch[index] = node.branch[node.count-1] - + node.branch[node.count-1].data = nil node.count-- } diff --git a/vendor/d3/rtree.go b/vendor/d3/rtree.go index e939c36..007de07 100644 --- a/vendor/d3/rtree.go +++ b/vendor/d3/rtree.go @@ -9,7 +9,6 @@ TITLE DESCRIPTION A Go version of the RTree algorithm. - For more information please read the comments in rtree.go AUTHORS @@ -379,7 +378,7 @@ func DisconnectBranch(node *Node, index int) { // Remove element by swapping with the last element to prevent gaps in array node.branch[index] = node.branch[node.count-1] - + node.branch[node.count-1].data = nil node.count-- } diff --git a/vendor/d4/rtree.go b/vendor/d4/rtree.go index dfc541a..3e2fd6a 100644 --- a/vendor/d4/rtree.go +++ b/vendor/d4/rtree.go @@ -9,7 +9,6 @@ TITLE DESCRIPTION A Go version of the RTree algorithm. - For more information please read the comments in rtree.go AUTHORS @@ -379,7 +378,7 @@ func DisconnectBranch(node *Node, index int) { // Remove element by swapping with the last element to prevent gaps in array node.branch[index] = node.branch[node.count-1] - + node.branch[node.count-1].data = nil node.count-- }