Open AlisterH opened 1 year ago
I'm not sure, but the crashes may only occur when using "simple mean value" calculation. But they don't occur every time I use it.
From the stack trace it seems that there is an issue with running the "qgis:zonalstatistics" tool. We could not immediately reproduce the error so we'd ask for you to provide us with the dataset and exact settings/inputs you are using.
OK, I think that particular crash only occurs when I run a simple mean value calculation and then run it again (without closing the plugin). A user is most likely to do that if they wanted to run the calculation twice with different base heights.
Sometimes the QGIS crash handler appears and other times it doesn't.
The main issue seems to be the call to the qgis:zonalstatistics program used for this calculation, as shown in your stacktrace.
results, ok = alg.run(parameters, context, feedback, {}, False) File "C:\PROGRA~1/QGIS32~1.0/apps/qgis/./python/plugins\processing\core\Processing.py", line 187 in runAlgorithm ret, results = execute(alg, parameters, context, feedback, catch_exceptions=False) File "C:\PROGRA~1/QGIS32~1.0/apps/qgis/./python/plugins\processing\tools\general.py", line 108 in run return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context) File "C:\Users/alistair/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\volume_calculation_tool\volume_calculation_tool.py", line 619 in getVolumeSimple result = processing.run("qgis:zonalstatistics", { 'COLUMN_PREFIX' : SIMPLE_WORKFLOW_HEIGHT_PREFIX, 'INPUT_RASTER' : self.current_task_options.height_layer, 'INPUT_VECTOR': self.current_task_options.vector_layer, 'RASTER_BAND' : self.current_task_options.height_dem_band, 'STATS' : [2] })
However since we cannot reproduce that behavior it is difficult for us to estimate where the issue exactly comes from. It may have something to do with the layers we are passing in. Are you using the example dataset we provide, or any other if so what layers are you using ?
Further testing seems to show it only occurs when the vector layer is a memory layer. At least, it doesn't occur if it is a shapefile. And I see that it crashes the second time I click "run" with "simple mean value" selected, even if I ran it with "accurate approximation" after running it the first time with "simple mean value".
Also note that there is another bug when using "simple mean value" - it always adds the output fields, even when "Add/Update Volume As Field" is unchecked.
I'm getting a crash. I don't have a stack trace at this stage (am on Windows and only allowed to use the standalone QGIS installer), but I'll post this now in case I can't get it again (previously the crash handler didn't even come up).