예제 #1
0
 def intersects_bounds(self, bounds):
     x0, y0, x1, y1 = bounds
     result = np.zeros(1, dtype=np.bool_)
     offsets = self.buffer_outer_offsets
     lines_intersect_bounds(float(x0), float(y0), float(x1), float(y1),
                            self.buffer_values, offsets[:-1], offsets[1:],
                            result)
     return result[0]
예제 #2
0
 def intersects_bounds(self, bounds):
     x0, y0, x1, y1 = bounds
     offsets = self.buffer_outer_offsets
     start_offsets = offsets[:-1]
     stop_offstes = offsets[1:]
     result = np.zeros(len(start_offsets), dtype=np.bool_)
     lines_intersect_bounds(float(x0), float(y0), float(x1), float(y1),
                            self.buffer_values, start_offsets, stop_offstes,
                            result)
     return result.any()
예제 #3
0
    def intersects_bounds(self, bounds, inds=None):
        x0, y0, x1, y1 = bounds
        offsets = self.buffer_outer_offsets
        start_offsets0 = offsets[:-1]
        stop_offsets0 = offsets[1:]
        if inds is not None:
            start_offsets0 = start_offsets0[inds]
            stop_offsets0 = stop_offsets0[inds]

        result = np.zeros(len(stop_offsets0), dtype=np.bool_)
        lines_intersect_bounds(float(x0), float(y0), float(x1), float(y1),
                               self.buffer_values, start_offsets0,
                               stop_offsets0, result)
        return result