예제 #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
파일: layer.py 프로젝트: atrawog/mapproxy
 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))