Skip to content

Commit

Permalink
增加获取树根节点功能
Browse files Browse the repository at this point in the history
  • Loading branch information
SimingLiu committed Dec 8, 2024
1 parent b834243 commit 3916c39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ func NewTree(dim, min, max int, objs ...Spatial) *Rtree {
return rt
}

// GetRoot 返回当前存储在树中的当前根节点。
// 添加/删除节点,可能会导致根节点变化。
func (tree *Rtree) GetRoot() *node {
return tree.root
}

// Size returns the number of objects currently stored in tree.
//
// 返回当前存储在树中的对象的数量。
Expand Down

0 comments on commit 3916c39

Please sign in to comment.