diff --git a/python/plugins/processing/algs/gdal/GdalAlgorithm.py b/python/plugins/processing/algs/gdal/GdalAlgorithm.py index 540b59277b1..c92ddb637a0 100644 --- a/python/plugins/processing/algs/gdal/GdalAlgorithm.py +++ b/python/plugins/processing/algs/gdal/GdalAlgorithm.py @@ -119,8 +119,8 @@ class GdalAlgorithm(QgsProcessingAlgorithm): elif input_layer.dataProvider().name().lower() == 'wfs': uri = QgsDataSourceUri(input_layer.source()) baseUrl = uri.param('url').split('?')[0] + ogr_data_path = "WFS:{}".format(baseUrl) ogr_layer_name = uri.param('typename') - ogr_data_path = "WFS:{} {}".format(baseUrl, ogr_layer_name) else: # vector layer, but not OGR - get OGR compatible path # TODO - handle "selected features only" mode!! diff --git a/python/plugins/processing/algs/gdal/GdalUtils.py b/python/plugins/processing/algs/gdal/GdalUtils.py index ed9194461e0..f8c4234916a 100644 --- a/python/plugins/processing/algs/gdal/GdalUtils.py +++ b/python/plugins/processing/algs/gdal/GdalUtils.py @@ -344,8 +344,7 @@ class GdalUtils: elif provider.lower() == "wfs": uri = QgsDataSourceUri(layer.source()) baseUrl = uri.param('url').split('?')[0] - layerName = uri.param('typename') - ogrstr = "WFS:{} {}".format(baseUrl, layerName) + ogrstr = "WFS:{}".format(baseUrl) format = 'WFS' else: ogrstr = str(layer.source()).split("|")[0] diff --git a/python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py b/python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py index c665365ba82..becffe5dba0 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py +++ b/python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py @@ -126,7 +126,7 @@ class Ogr2OgrTableToPostGisList(GdalAlgorithm): uri = GeoDB(uri=uri).uri inLayer = self.getParameterValue(self.INPUT_LAYER) - ogrLayer = GdalUtils.ogrConnectionStringFromLayer(inLayer) + ogrLayer, layerName = self.getOgrCompatibleSource(self.INPUT, parameters, context, feedback, executing) shapeEncoding = self.getParameterValue(self.SHAPE_ENCODING) schema = str(self.getParameterValue(self.SCHEMA)) table = str(self.getParameterValue(self.TABLE)) @@ -161,7 +161,7 @@ class Ogr2OgrTableToPostGisList(GdalAlgorithm): arguments.append('"') arguments.append(ogrLayer) arguments.append('-nlt NONE') - arguments.append(GdalUtils.ogrLayerName(inLayer)) + arguments.append(layerName) if launder: arguments.append(launderstring) if append: @@ -175,7 +175,7 @@ class Ogr2OgrTableToPostGisList(GdalAlgorithm): elif primary_key is not None: arguments.append("-lco FID=" + primary_key) if len(table) == 0: - table = GdalUtils.ogrLayerName(inLayer).lower() + table = layerName.lower() if schema: table = '{}.{}'.format(schema, table) arguments.append('-nln') diff --git a/python/plugins/processing/algs/gdal/ogrinfo.py b/python/plugins/processing/algs/gdal/ogrinfo.py index 0bc2609bddb..d51657abed7 100644 --- a/python/plugins/processing/algs/gdal/ogrinfo.py +++ b/python/plugins/processing/algs/gdal/ogrinfo.py @@ -81,8 +81,9 @@ class ogrinfo(GdalAlgorithm): if inLayer is None: raise QgsProcessingException(self.invalidSourceError(parameters, self.INPUT)) - connectionString = GdalUtils.ogrConnectionStringFromLayer(inLayer) - arguments.append(connectionString) + ogrLayer, layerName = self.getOgrCompatibleSource(self.INPUT, parameters, context, feedback, executing) + arguments.append(ogrLayer) + arguments.append(layerName) return [self.commandName(), GdalUtils.escapeAndJoin(arguments)] def processAlgorithm(self, parameters, context, feedback):