Skip to content
Permalink
Browse files

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 046f3ae09e745dcac2398f42f6a696fede08e7ca
Showing with 15 additions and 1 deletion.
  1. +15 −1 python/plugins/processing/algs/qgis/Relief.py
@@ -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.
You can’t perform that action at this time.