Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8318 from rldhont/processing-convertformat-geopac…
…kage

[Processing] Add GeoPackage support in alg qgis:convertformat (forward)
  • Loading branch information
rldhont committed Oct 25, 2018
2 parents 221df8e + 1d246de commit 236edd2
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)

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)))

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" ' +
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):
context = QgsProcessingContext()
feedback = QgsProcessingFeedback()
Expand Down

0 comments on commit 236edd2

Please sign in to comment.