本文整理汇总了Python中ocgis.api.operations.OcgOperations._get_object_方法的典型用法代码示例。如果您正苦于以下问题:Python OcgOperations._get_object_方法的具体用法?Python OcgOperations._get_object_怎么用?Python OcgOperations._get_object_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ocgis.api.operations.OcgOperations
的用法示例。
在下文中一共展示了OcgOperations._get_object_方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_init
# 需要导入模块: from ocgis.api.operations import OcgOperations [as 别名]
# 或者: from ocgis.api.operations.OcgOperations import _get_object_ [as 别名]
def test_init(self):
with self.assertRaises(DefinitionValidationError):
OcgOperations()
ops = OcgOperations(dataset=self.datasets)
self.assertEqual(ops.regrid_destination, None)
self.assertDictEqual(ops.regrid_options, RegridOptions.default)
self.assertIsNone(ops.geom_select_uid)
self.assertIsNone(ops.geom_uid)
self.assertFalse(ops.melted)
env.MELTED = True
ops = OcgOperations(dataset=self.datasets)
self.assertEqual(ops.melted, env.MELTED)
self.assertTrue(ops.melted)
ops = OcgOperations(dataset=self.datasets, geom_select_uid=[4, 5], select_ugid=[5, 6, 7])
self.assertEqual(ops.geom_select_uid, (4, 5))
ops = OcgOperations(dataset=self.datasets, geom_uid='ID')
self.assertEqual(ops.geom_uid, 'ID')
geom = ops._get_object_('geom')
self.assertEqual(geom.geom_uid, 'ID')
s = 'STATE_NAME in ("Wisconsin", "Vermont")'
ops = OcgOperations(dataset=self.datasets, geom_select_sql_where=s, geom='state_boundaries')
self.assertEqual(ops.geom_select_sql_where, s)
self.assertEqual(len(ops.geom), 2)