Skip to content

Commit

Permalink
WIP Quadtree
Browse files Browse the repository at this point in the history
  • Loading branch information
mlerner authored and paulmach committed Nov 12, 2015
1 parent 73f7a20 commit c6dd806
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
46 changes: 46 additions & 0 deletions clustering/quadtree/quadtree.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package quadtree

import (
"github.com/paulmach/go.geo"
)

type Quadtree struct {
TreeExtent *Extent
}

type QuadTreeNode struct {
Leaf bool
Nodes []*QuadTreeNode
Point *geo.Point
}

type Extent struct {
TopLeft *geo.Point
BottomRight *geo.Point
}

type visitFunction func(*geo.Point, float64, float64, float64, float64) bool

func NewFromPoints(points *geo.PointSet) *Quadtree {
return &Quadtree{}
}

func New() *Quadtree {
return &Quadtree{}
}

func (q *Quadtree) Add(p *geo.Point) *Quadtree {
return nil
}

func (q *Quadtree) Visit(visit visitFunction) {
return nil
}

func (q *Quadtree) Find(p *geo.Point) *geo.Point {
return nil
}

func (q *Quadtree) SetExtent(e *Extent) {
q.TreeExtent = Extent
}
11 changes: 11 additions & 0 deletions clustering/quadtree/quadtree_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package quadtree

import (
"testing"
)

func TestSingleNodeNoBounds(t *testing.T) {
}

func TestLocateSinglePoint(t *testing.T) {
}

0 comments on commit c6dd806

Please sign in to comment.