Skip to content

Commit

Permalink
Merge pull request #58116 from qgis/backport-58102-to-release-3_38
Browse files Browse the repository at this point in the history
[Backport release-3_38] Fix GRASS provider ignores default output vector format setting in Processing
  • Loading branch information
alexbruy authored Jul 16, 2024
2 parents fb62a8d + b10d8eb commit 90eaea1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions python/plugins/grassprovider/grass_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,27 +153,18 @@ def svgIconPath(self):
def versionInfo(self):
return GrassUtils.installedVersion() or None

def defaultVectorFileExtension(self, hasGeometry=True):
# By default,'gpkg', but if OGR has not been compiled with sqlite3, then
# we take "SHP"
if 'GPKG' in [o.driverName for o in
QgsVectorFileWriter.ogrDriverList()]:
return 'gpkg'
else:
return 'shp' if hasGeometry else 'dbf'

def supportsNonFileBasedOutput(self):
"""
GRASS Provider doesn't support non file based outputs
"""
return False

def supportedOutputVectorLayerExtensions(self):
# We use the same extensions than QGIS because:
# We use the same extensions as QGIS because:
# - QGIS is using OGR like GRASS
# - There are very chances than OGR version used in GRASS is
# - There are very few chances that OGR version used in GRASS is
# different from QGIS OGR version.
return QgsVectorFileWriter.supportedFormatExtensions()
return super().supportedOutputVectorLayerExtensions()

def supportedOutputRasterLayerExtensions(self):
return GrassUtils.getSupportedOutputRasterExtensions()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/grassprovider/grass_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def grassHelpPath():

@staticmethod
def getSupportedOutputRasterExtensions():
# We use the same extensions than GDAL because:
# We use the same extensions as GDAL because:
# - GRASS is also using GDAL for raster imports.
# - Chances that GRASS is compiled with another version of
# GDAL than QGIS are very limited!
Expand Down

0 comments on commit 90eaea1

Please sign in to comment.