mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Better approach for preferredFormat
This commit is contained in:
parent
6918f230b8
commit
28b24bda51
@ -87,13 +87,9 @@ class GdalAlgorithm(QgsProcessingAlgorithm):
|
||||
if executing:
|
||||
# parameter is not a vector layer - try to convert to a source compatible with OGR
|
||||
# and extract selection if required
|
||||
if 'gpkg' in QgsVectorFileWriter.supportedFormatExtensions():
|
||||
preferred_format = 'gpkg'
|
||||
else:
|
||||
preferred_format = 'shp'
|
||||
ogr_data_path = self.parameterAsCompatibleSourceLayerPath(parameters, parameter_name, context,
|
||||
QgsVectorFileWriter.supportedFormatExtensions(),
|
||||
preferred_format,
|
||||
QgsVectorFileWriter.supportedFormatExtensions()[0],
|
||||
feedback=feedback)
|
||||
ogr_layer_name = GdalUtils.ogrLayerName(ogr_data_path)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user