import_gmlas_panel.py 文件源码

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

项目:gml_application_schema_toolbox 作者: BRGM 项目源码 文件源码
def gmlas_datasource(self):
        gmlasconf = self.gmlas_config()
        datasourceFile = self.gmlPathLineEdit.text()
        if datasourceFile == '':
            raise InputError(self.tr("You must select a input file or URL"))
        isXsd = datasourceFile.endswith(".xsd")
        isUrl = datasourceFile.startswith("http")
        swapCoordinates = self.swapCoordinatesCombo.currentText()
        driverConnection = ""
        openOptions = ['EXPOSE_METADATA_LAYERS=YES', 'CONFIG_FILE={}'.format(gmlasconf)]

        openOptions.append('SWAP_COORDINATES={}'.format(swapCoordinates))

        if isXsd:
            driverConnection = "GMLAS:"
            openOptions.append('XSD={}'.format(datasourceFile))
        elif isUrl:
            driverConnection = "GMLAS:/vsicurl_streaming/{}".format(datasourceFile)
        else:
            driverConnection = "GMLAS:{}".format(datasourceFile)

        with qgis_proxy_settings():
            return gdal.OpenEx(driverConnection,
                               open_options=openOptions)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号