Skip to content

Commit 3916c39

Browse files
committed
增加获取树根节点功能
1 parent b834243 commit 3916c39

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

rtree.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ func NewTree(dim, min, max int, objs ...Spatial) *Rtree {
6969
return rt
7070
}
7171

72+
// GetRoot 返回当前存储在树中的当前根节点。
73+
// 添加/删除节点,可能会导致根节点变化。
74+
func (tree *Rtree) GetRoot() *node {
75+
return tree.root
76+
}
77+
7278
// Size returns the number of objects currently stored in tree.
7379
//
7480
// 返回当前存储在树中的对象的数量。

0 commit comments

Comments
 (0)