mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Merge pull request #36731 from alexbruy/relief-results
check return value from the QgsRelief and notify user about errors (fix #17452)
This commit is contained in:
commit
2a2fe1e095
@ -156,6 +156,20 @@ class Relief(QgisAlgorithm):
|
||||
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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user