Skip to content

Commit

Permalink
handle possibillity that bbox may be a 6-tuple
Browse files Browse the repository at this point in the history
coordstring v0.2.0 now returns a 6-tuple when coordinates are 3D, so
check for this case
  • Loading branch information
njwilson23 committed Oct 21, 2017
1 parent c18b271 commit f767dd6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion karta/vector/quadtree.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ cdef class QuadTree:
cdef int i = 0
cdef int idup = 0
cdef dict duplicates = {}
cdef tuple _bb

_bb = points.bbox()
if len(_bb) == 4:
xmin, ymin, xmax, ymax = _bb
else:
xmin, ymin, _, xmax, ymax, _ = _bb

xmin, ymin, xmax, ymax = points.bbox()
bbox = qt_new_bbox(xmin, ymin, xmax, ymax)
self.root.leafnode = qt_new_leaf(leaf_capacity, bbox)

Expand Down

0 comments on commit f767dd6

Please sign in to comment.