Python osgeo.gdal.PopErrorHandler() Examples

The following are code examples for showing how to use osgeo.gdal.PopErrorHandler(). They are extracted from open source Python projects. You can vote up the examples you like or vote down the ones you don't like. You can also save this page to your account.

Example 1
Project: gml_application_schema_toolbox   Author: BRGM   File: gmlas_panel_mixin.py    (license) View Source Project 6 votes vote down vote up
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