本文整理汇总了Python中openquake.hazardlib.site.SiteCollection.within方法的典型用法代码示例。如果您正苦于以下问题:Python SiteCollection.within方法的具体用法?Python SiteCollection.within怎么用?Python SiteCollection.within使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openquake.hazardlib.site.SiteCollection
的用法示例。
在下文中一共展示了SiteCollection.within方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_within_region
# 需要导入模块: from openquake.hazardlib.site import SiteCollection [as 别名]
# 或者: from openquake.hazardlib.site.SiteCollection import within [as 别名]
def test_within_region(self):
region = wkt.loads('POLYGON((0 0, 9 0, 9 9, 0 9, 0 0))')
col = SiteCollection(self.SITES)
reducedcol = col.within(region)
# point (10, 20) is out, point (11, 12) is out, point (0, 2)
# is on the boundary i.e. out, (1, 1) is in
self.assertEqual(len(reducedcol), 1)