Example #1
0
 def contains(self, other):
     if not isinstance(other, MapExtent):
         raise NotImplemented
     if self.is_default:
         # DefaultMapExtent contains everything
         return True
     return bbox_contains(self.bbox, other.bbox_for(self.srs))
Example #2
0
 def contains(self, other):
     if not isinstance(other, MapExtent):
         raise NotImplemented
     if self.is_default:
         # DefaultMapExtent contains everything
         return True
     return bbox_contains(self.bbox, other.bbox_for(self.srs))
Example #3
0
 def contains(self, bbox, srs):
     bbox = self._bbox_in_coverage_srs(bbox, srs)
     return bbox_contains(self.bbox, bbox)
Example #4
0
 def test_no_intersect_only_vertical(self):
     b1 = (0, 0, 10, 10)
     b2 = (20, 0, 30, 10)
     assert not bbox_contains(b1, b2)
     assert not bbox_contains(b2, b1)
Example #5
0
 def test_overlap(self):
     b1 = (0, 0, 10, 10)
     b2 = (-5, -5, 5, 5)
     assert not bbox_contains(b1, b2)
     assert not bbox_contains(b2, b1)
Example #6
0
 def test_contains_touch(self):
     b1 = (0, 0, 10, 10)
     b2 = (0, 0, 8, 8)
     assert bbox_contains(b1, b2)
     assert not bbox_contains(b2, b1)
Example #7
0
 def test_full_contains(self):
     b1 = (0, 0, 10, 10)
     b2 = (2, 2, 8, 8)
     assert bbox_contains(b1, b2)
     assert not bbox_contains(b2, b1)
Example #8
0
 def test_no_intersect_touch_side(self):
     b1 = (0, 0, 10, 10)
     b2 = (0, 10, 10, 20)
     assert not bbox_contains(b1, b2)
     assert not bbox_contains(b2, b1)
Example #9
0
 def test_overlap(self):
     b1 = (0, 0, 10, 10)
     b2 = (-5, -5, 5, 5)
     assert not bbox_contains(b1, b2)
     assert not bbox_contains(b2, b1)
Example #10
0
 def test_contains_touch(self):
     b1 = (0, 0, 10, 10)
     b2 = (0, 0, 8, 8)
     assert bbox_contains(b1, b2)
     assert not bbox_contains(b2, b1)
Example #11
0
 def test_full_contains(self):
     b1 = (0, 0, 10, 10)
     b2 = (2, 2, 8, 8)
     assert bbox_contains(b1, b2)
     assert not bbox_contains(b2, b1)
Example #12
0
 def test_no_intersect_touch_side(self):
     b1 = (0, 0, 10, 10)
     b2 = (0, 10, 10, 20)
     assert not bbox_contains(b1, b2)
     assert not bbox_contains(b2, b1)
Example #13
0
 def test_no_intersect_only_vertical(self):
     b1 = (0, 0, 10, 10)
     b2 = (20, 0, 30, 10)
     assert not bbox_contains(b1, b2)
     assert not bbox_contains(b2, b1)
Example #14
0
 def contains(self, other):
     if not isinstance(other, MapExtent):
         raise NotImplemented
     return bbox_contains(self.bbox, other.bbox_for(self.srs))
Example #15
0
 def contains(self, bbox, srs):
     bbox = self._bbox_in_coverage_srs(bbox, srs)
     return bbox_contains(self.bbox, bbox)
Example #16
0
 def contains(self, other):
     if not isinstance(other, MapExtent):
         raise NotImplemented
     return bbox_contains(self.bbox, other.bbox_for(self.srs))