示例#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))