Пример #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))
Пример #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))
Пример #3
0
 def contains(self, bbox, srs):
     bbox = self._bbox_in_coverage_srs(bbox, srs)
     return bbox_contains(self.bbox, bbox)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #14
0
 def contains(self, other):
     if not isinstance(other, MapExtent):
         raise NotImplemented
     return bbox_contains(self.bbox, other.bbox_for(self.srs))
Пример #15
0
 def contains(self, bbox, srs):
     bbox = self._bbox_in_coverage_srs(bbox, srs)
     return bbox_contains(self.bbox, bbox)
Пример #16
0
 def contains(self, other):
     if not isinstance(other, MapExtent):
         raise NotImplemented
     return bbox_contains(self.bbox, other.bbox_for(self.srs))