Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport queued_ltr_backports] Fix GRASS provider ignores default output vector format setting in Processing #58115

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions python/plugins/grassprovider/Grass7AlgorithmProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,27 +133,18 @@ def svgIconPath(self):
def versionInfo(self):
return Grass7Utils.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):
"""
GRASS7 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 Grass7Utils.getSupportedOutputRasterExtensions()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/grassprovider/Grass7Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,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
Loading