Skip to content

Commit e5ad556

Browse files
committed
implement isspatialtree for STR types
1 parent 9efde48 commit e5ad556

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/SpatialTreeInterface/SpatialTreeInterface.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,20 @@ end
200200

201201
using SortTileRecursiveTree: STRtree, STRNode, STRLeafNode
202202

203+
isspatialtree(::Type{<: STRtree}) = true
203204
nchild(tree::STRtree) = nchild(tree.rootnode)
204205
getchild(tree::STRtree) = getchild(tree.rootnode)
205206
getchild(tree::STRtree, i) = getchild(tree.rootnode, i)
206207
isleaf(tree::STRtree) = isleaf(tree.rootnode)
207208
child_indices_extents(tree::STRtree) = child_indices_extents(tree.rootnode)
208209

209-
210+
isspatialtree(::Type{<: STRNode}) = true
210211
nchild(node::STRNode) = length(node.children)
211212
getchild(node::STRNode) = node.children
212213
getchild(node::STRNode, i) = node.children[i]
213214
isleaf(node::STRNode) = false # STRNodes are not leaves by definition
214215

216+
isspatialtree(::Type{<: STRLeafNode}) = true
215217
isleaf(node::STRLeafNode) = true
216218
child_indices_extents(node::STRLeafNode) = zip(node.indices, node.extents)
217219

0 commit comments

Comments
 (0)