Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
check return value from the QgsRelief and notify user (fix #17452)
(cherry picked from commit 5d03f2b)
  • Loading branch information
alexbruy authored and nyalldawson committed Jun 19, 2020
1 parent 11c294d commit 046f3ae
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion python/plugins/processing/algs/qgis/Relief.py
Expand Up @@ -157,6 +157,20 @@ def processAlgorithm(self, parameters, context, feedback):
relief.setZFactor(zFactor)
if frequencyDistribution:
relief.exportFrequencyDistributionToCsv(frequencyDistribution)
relief.processRaster(feedback)
res = relief.processRaster(feedback)
if res == 1:
raise QgsProcessingException(self.tr('Can not open input file.'))
elif res == 2:
raise QgsProcessingException(self.tr('Can not get GDAL driver for output file.'))
elif res == 3:
raise QgsProcessingException(self.tr('Can not create output file.'))
elif res == 4:
raise QgsProcessingException(self.tr('Can not get input band.'))
elif res == 5:
raise QgsProcessingException(self.tr('Can not create output bands.'))
elif res == 6:
raise QgsProcessingException(self.tr('Output raster size is too small (at least 3 rows needed).'))
elif res == 7:
feedback.pushInfo(self.tr('Cancelled.'))

return {self.OUTPUT: outputFile, self.FREQUENCY_DISTRIBUTION: frequencyDistribution}

0 comments on commit 046f3ae

Please sign in to comment.