当前位置: 首页>>代码示例>>Python>>正文


Python ImpactLayerMetadata.append_provenance_step方法代码示例

本文整理汇总了Python中safe.metadata.ImpactLayerMetadata.append_provenance_step方法的典型用法代码示例。如果您正苦于以下问题:Python ImpactLayerMetadata.append_provenance_step方法的具体用法?Python ImpactLayerMetadata.append_provenance_step怎么用?Python ImpactLayerMetadata.append_provenance_step使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在safe.metadata.ImpactLayerMetadata的用法示例。


在下文中一共展示了ImpactLayerMetadata.append_provenance_step方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: generate_test_metadata

# 需要导入模块: from safe.metadata import ImpactLayerMetadata [as 别名]
# 或者: from safe.metadata.ImpactLayerMetadata import append_provenance_step [as 别名]
    def generate_test_metadata(self):
        # if you change this you need to update IMPACT_TEST_FILE_JSON
        good_data = {
            'start_time': '20140714_060955',
            'finish_time': '20140714_061255',
            'hazard_layer': 'path/to/hazard/layer',
            'exposure_layer': 'path/to/exposure/layer',
            'impact_function_id': 'IF_id',
            'impact_function_version': '2.1',
            'host_name': 'my_computer',
            'user': 'my_user',
            'qgis_version': '2.4',
            'gdal_version': '1.9.1',
            'qt_version': '4.5',
            'pyqt_version': '5.1',
            'os': 'ubuntu 12.04',
            'inasafe_version': '2.1',
            'exposure_pixel_size': '0.1',
            'hazard_pixel_size': '0.2',
            'impact_pixel_size': '0.1',
            'actual_extent': [0, 1, 2, 2],
            'requested_extent': [0, 1, 2, 2],
            'actual_extent_crs': 'EPSG: 4326',
            'requested_extent_crs': 'EPSG: 4326',
            'parameter': {},
        }
        metadata = ImpactLayerMetadata('random_layer_id')
        path = TEST_XML_BASEPATH + 'gco:CharacterString'
        # using str
        test_value = 'Random string'
        metadata.set('ISO19115_STR', test_value, path)
        test_value = 1234
        metadata.set('ISO19115_INT', test_value, path)
        test_value = 1234.5678
        metadata.set('ISO19115_FLOAT', test_value, path)

        metadata.report = 'My super report'
        metadata.summary_data = {'res1': 1234, 'res2': 4321}
        metadata.date = datetime.strptime(
            '2016-02-18T12:34:56', '%Y-%m-%dT%H:%M:%S')
        metadata.url = QUrl('http://inasafe.org')

        metadata.append_provenance_step(
            'Title 1', 'Description of step 1', '2015-06-25T13:14:24.508974')
        metadata.append_provenance_step(
            'Title 2', 'Description of step 2', '2015-06-25T13:14:24.508980')
        metadata.append_provenance_step(
            'Title 3', 'Description of step 3', '2015-06-25T13:14:24.508984')
        metadata.append_if_provenance_step(
            'IF Provenance',
            'IF Provenance',
            '2015-06-25T13:14:24.510000',
            good_data
        )

        return metadata
开发者ID:easmetz,项目名称:inasafe,代码行数:58,代码来源:test_impact_metadata.py

示例2: generate_test_metadata

# 需要导入模块: from safe.metadata import ImpactLayerMetadata [as 别名]
# 或者: from safe.metadata.ImpactLayerMetadata import append_provenance_step [as 别名]
    def generate_test_metadata(self):
        # if you change this you need to update IMPACT_TEST_FILE_JSON
        metadata = ImpactLayerMetadata('random_layer_id')
        path = 'gmd:MD_Metadata/gmd:dateStamp/'
        path = TEST_XML_BASEPATH + 'gco:CharacterString'
        # using str
        test_value = 'Random string'
        metadata.set('ISO19115_STR', test_value, path)
        test_value = 1234
        metadata.set('ISO19115_INT', test_value, path)
        test_value = 1234.5678
        metadata.set('ISO19115_FLOAT', test_value, path)

        metadata.report = 'My super report'
        metadata.summary_data = {'res1': 1234, 'res2': 4321}

        metadata.append_provenance_step(
            'Title 1', 'Description of step 1', '2015-06-25T13:14:24.508974')
        metadata.append_provenance_step(
            'Title 2', 'Description of step 2', '2015-06-25T13:14:24.508980')
        metadata.append_provenance_step(
            'Title 3', 'Description of step 3', '2015-06-25T13:14:24.508984')

        return metadata
开发者ID:dynaryu,项目名称:inasafe,代码行数:26,代码来源:test_impact_metadata.py


注:本文中的safe.metadata.ImpactLayerMetadata.append_provenance_step方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。