import_gmlas_panel.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:gml_application_schema_toolbox 作者: BRGM 项目源码 文件源码
def on_convertButton_clicked(self):
        gdal.SetConfigOption("OGR_SQLITE_SYNCHRONOUS", "OFF")
        gdal.SetConfigOption('GDAL_HTTP_UNSAFESSL', 'YES')

        dest = self.databaseWidget.datasource_name()
        if dest == '' and self.databaseWidget.format() == "SQLite":
            with tempfile.NamedTemporaryFile(suffix='.sqlite') as tmp:
                dest = tmp.name

        if dest.startswith('PG:'):
            schema = self.databaseWidget.schema()
        else:
            schema = None

        try:
            QApplication.setOverrideCursor(Qt.WaitCursor)
            self.translate(self.import_params(dest))
            import_in_qgis(dest, self.databaseWidget.format(), schema)

        except InputError as e:
            e.show()
        except RuntimeError as e:
            QMessageBox.warning(None,
                                plugin_name(),
                                e.args[0])
        finally:
            QApplication.restoreOverrideCursor()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号