本文整理汇总了Python中nansat.domain.Domain.intersects方法的典型用法代码示例。如果您正苦于以下问题:Python Domain.intersects方法的具体用法?Python Domain.intersects怎么用?Python Domain.intersects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nansat.domain.Domain
的用法示例。
在下文中一共展示了Domain.intersects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_overlaps_intersects_and_contains
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import intersects [as 别名]
def test_overlaps_intersects_and_contains(self):
Bergen = Domain(4326, "-te 5 60 6 61 -ts 500 500")
WestCoast = Domain(4326, "-te 1 58 6 64 -ts 500 500")
Norway = Domain(4326, "-te 3 55 30 72 -ts 500 500")
Paris = Domain(4326, "-te 2 48 3 49 -ts 500 500")
self.assertFalse(Bergen.overlaps(Norway))
self.assertFalse(Norway.overlaps(Bergen))
self.assertTrue(Norway.overlaps(WestCoast))
self.assertFalse(Paris.overlaps(Norway))
self.assertTrue(Bergen.intersects(Norway))
self.assertTrue(Norway.intersects(Bergen))
self.assertTrue(Norway.intersects(WestCoast))
self.assertFalse(Paris.intersects(Norway))
self.assertTrue(Norway.contains(Bergen))
self.assertFalse(Bergen.contains(Norway))
self.assertFalse(Norway.contains(WestCoast)) # why false?
self.assertFalse(Paris.contains(Norway))
示例2: test_intersects
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import intersects [as 别名]
def test_intersects(self, get_border_geometry):
other_domain = MagicMock()
d = Domain()
d.intersects(other_domain)
d.get_border_geometry.assert_called_once()
d.get_border_geometry().Intersects.assert_called_once_with(other_domain.get_border_geometry())