Skip to content

Commit

Permalink
[Processing] Add GeoPackage support in alg qgis:convertformat (forward)
Browse files Browse the repository at this point in the history
This is the forward porting of #8143
  • Loading branch information
rldhont committed Oct 25, 2018
1 parent 0bd1b7a commit 1d246de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ogr2ogr.py
Expand Up @@ -82,7 +82,7 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):


output, outputFormat = GdalUtils.ogrConnectionStringAndFormat(outFile, context) output, outputFormat = GdalUtils.ogrConnectionStringAndFormat(outFile, context)


if outputFormat == 'SQLite' and os.path.isfile(output): if outputFormat in ('SQLite', 'GPKG') and os.path.isfile(output):
raise QgsProcessingException(self.tr('Output file "{}" already exists.'.format(output))) raise QgsProcessingException(self.tr('Output file "{}" already exists.'.format(output)))


arguments = [] arguments = []
Expand Down
7 changes: 7 additions & 0 deletions python/plugins/processing/tests/GdalAlgorithmsTest.py
Expand Up @@ -1458,6 +1458,13 @@ def testOgr2Ogr(self):
'-f "LIBKML" "' + outdir + '/my out/check.kml" ' + '-f "LIBKML" "' + outdir + '/my out/check.kml" ' +
source + ' polys2']) source + ' polys2'])


self.assertEqual(
alg.getConsoleCommands({'INPUT': source,
'OUTPUT': outdir + '/check.gpkg'}, context, feedback),
['ogr2ogr',
'-f "GPKG" ' + outdir + '/check.gpkg ' +
source + ' polys2'])

def testOgr2PostGis(self): def testOgr2PostGis(self):
context = QgsProcessingContext() context = QgsProcessingContext()
feedback = QgsProcessingFeedback() feedback = QgsProcessingFeedback()
Expand Down

0 comments on commit 1d246de

Please sign in to comment.