From f767dd6287b8dbb0ef7ef4219ebed7483bef9d3d Mon Sep 17 00:00:00 2001 From: Nat Wilson Date: Sat, 21 Oct 2017 15:43:54 -0700 Subject: [PATCH] handle possibillity that bbox may be a 6-tuple coordstring v0.2.0 now returns a 6-tuple when coordinates are 3D, so check for this case --- karta/vector/quadtree.pyx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/karta/vector/quadtree.pyx b/karta/vector/quadtree.pyx index 624c23a..7769fd8 100644 --- a/karta/vector/quadtree.pyx +++ b/karta/vector/quadtree.pyx @@ -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)