Python osgeo.gdal 模块,PopErrorHandler() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用osgeo.gdal.PopErrorHandler()

项目:gml_application_schema_toolbox    作者:BRGM    | 项目源码 | 文件源码
def translate(self, params):
        if params is None:
            return
        params['callback'] = self.translate_callback

        dlg = QProgressDialog(self)
        dlg.setWindowTitle(plugin_name())
        dlg.setLabelText('Operation in progress')
        dlg.setMinimum(0)
        dlg.setMaximum(100)
        dlg.setWindowModality(Qt.WindowModal)
        self.progress_dlg = dlg

        self.setCursor(Qt.WaitCursor)
        try:
            log("gdal.VectorTranslate({})".format(str(params)))
            gdal.PushErrorHandler(gdal_error_handler)
            with qgis_proxy_settings():
                res = gdal.VectorTranslate(**params)
            gdal.PopErrorHandler()
            log(str(res))
        finally:
            self.unsetCursor()
            self.progress_dlg.reset()
            self.progress_dlg = None