Skip to content
Permalink
Browse files

[processing][needs-docs] native vector split algorithm now outputs

GeoPackages instead of shapefiles (refs #20557)

Also remove default output extension Processing settings as they are not
used anymore.

(cherry picked from commit 8446d3b)
  • Loading branch information
alexbruy authored and nyalldawson committed Jan 29, 2019
1 parent 722e4fe commit a9466cd097b05b6c863dd71f50c6262cd208647b
@@ -108,7 +108,7 @@ def processAlgorithm(self, parameters, context, feedback):
for current, i in enumerate(uniqueValues):
if feedback.isCanceled():
break
fName = u'{0}_{1}.shp'.format(baseName, str(i).strip())
fName = '{0}_{1}.gpkg'.format(baseName, str(i).strip())
feedback.pushInfo(self.tr('Creating layer: {}').format(fName))

sink, dest = QgsProcessingUtils.createFeatureSink(fName, context, fields, geomType, crs)
@@ -58,8 +58,6 @@ class ProcessingConfig:
POST_EXECUTION_SCRIPT = 'POST_EXECUTION_SCRIPT'
SHOW_CRS_DEF = 'SHOW_CRS_DEF'
WARN_UNMATCHING_CRS = 'WARN_UNMATCHING_CRS'
DEFAULT_OUTPUT_RASTER_LAYER_EXT = 'DEFAULT_OUTPUT_RASTER_LAYER_EXT'
DEFAULT_OUTPUT_VECTOR_LAYER_EXT = 'DEFAULT_OUTPUT_VECTOR_LAYER_EXT'
SHOW_PROVIDERS_TOOLTIP = 'SHOW_PROVIDERS_TOOLTIP'

settings = {}
@@ -136,24 +134,6 @@ def initialize():
valuetype=Setting.SELECTION,
options=invalidFeaturesOptions))

extensions = QgsVectorFileWriter.supportedFormatExtensions()
ProcessingConfig.addSetting(Setting(
ProcessingConfig.tr('General'),
ProcessingConfig.DEFAULT_OUTPUT_VECTOR_LAYER_EXT,
ProcessingConfig.tr('Default output vector layer extension'),
extensions[0],
valuetype=Setting.SELECTION,
options=extensions))

extensions = QgsRasterFileWriter.supportedFormatExtensions()
ProcessingConfig.addSetting(Setting(
ProcessingConfig.tr('General'),
ProcessingConfig.DEFAULT_OUTPUT_RASTER_LAYER_EXT,
ProcessingConfig.tr('Default output raster layer extension'),
extensions[0],
valuetype=Setting.SELECTION,
options=extensions))

@staticmethod
def setGroupIcon(group, icon):
ProcessingConfig.settingIcons[group] = icon

0 comments on commit a9466cd

Please sign in to comment.
You can’t perform that action at this time.