Skip to content

Commit 5ce0888

Browse files
committed
fix issue 2
1 parent 18c7585 commit 5ce0888

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bkdtree_intersect.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,18 @@ func (bkd *BkdTree) intersectNode(visitor IntersectVisitor, data []byte,
6565
if err != nil {
6666
return
6767
}
68-
for _, child := range node.Children {
68+
lowVal := lowP.Vals[node.SplitDim]
69+
highVal := highP.Vals[node.SplitDim]
70+
for i, child := range node.Children {
6971
if child.NumPoints <= 0 {
7072
continue
7173
}
74+
if i < int(node.NumStrips)-1 && node.SplitValues[i] < lowVal {
75+
continue
76+
}
77+
if i != 0 && node.SplitValues[i-1] > highVal {
78+
continue
79+
}
7280
if child.Offset < meta.PointsOffEnd {
7381
//leaf node
7482
pae := PointArrayExt{

0 commit comments

Comments
 (0)