Skip to content
Permalink
Browse files

Fix layers loading...

  • Loading branch information
Médéric RIBREUX
Médéric RIBREUX committed Oct 22, 2017
1 parent 4b8b6a0 commit d6fb7181aa0578c877bced2cabc08d0a076eb089
Showing with 3 additions and 6 deletions.
  1. +3 −6 python/plugins/processing/algs/grass7/Grass7Algorithm.py
@@ -380,7 +380,7 @@ def processInputs(self, parameters, context):
paramName = param.name()
if not paramName in parameters:
continue
if len(parameters[paramName]) == 0:
if isinstance(parameters[paramName], str) and len(parameters[paramName]) == 0:
continue
# Raster inputs needs to be imported into temp GRASS DB
if isinstance(param, QgsProcessingParameterRasterLayer):
@@ -675,12 +675,10 @@ def exportVectorLayerFromParameter(self, name, parameters, context):
fileName = self.parameterAsOutputLayer(parameters, name, context)
# Find if there is a dataType
dataType = self.outType
QgsMessageLog.logMessage('outType: {}'.format(dataType), 'DEBUG', QgsMessageLog.INFO)
if self.outType == 'auto':
parameter = self.parameterDefinition(name)
if parameter:
layerType = parameter.dataType()
QgsMessageLog.logMessage('layerType: {}'.format(layerType), 'DEBUG', QgsMessageLog.INFO)
if layerType in self.QGIS_OUTPUT_TYPES:
dataType = self.QGIS_OUTPUT_TYPES[layerType]

@@ -696,13 +694,12 @@ def exportVectorLayer(self, grassName, fileName, dataType='auto', layer=None, no
"""
for cmd in [self.commands, self.outputCommands]:
cmd.append(
'v.out.ogr{0} type={1}{2}input="{3}" output="{4}"{5}'.format(
'v.out.ogr{0} type={1} {2} input="{3}" output="{4}" {5}'.format(
'' if nocats else ' -c',
dataType,
' layer={}'.format(layer) if layer else '',
'layer={}'.format(layer) if layer else '',
grassName,
fileName,
os.path.splitext(os.path.basename(fileName))[0],
'format=ESRI_Shapefile --overwrite'
)
)

0 comments on commit d6fb718

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