Skip to content

Commit

Permalink
Fix out-of-bounds error on empty rtree queries
Browse files Browse the repository at this point in the history
  • Loading branch information
funkey committed Jul 10, 2024
1 parent 792f999 commit 1989e0e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spatial_graph/rtree_wrapper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ cdef class RTree:

cdef search_results results
cdef size_t num_results = self.count(bb_min, bb_max)

# TODO: initialize with node dtype equivalent
data_array = np.zeros((num_results,), dtype=np.uint64)
if num_results == 0:
return data_array
init_search_results_from_numpy(&results, data_array)

impl.rtree_search(
Expand Down

0 comments on commit 1989e0e

Please sign in to comment.