MathieuChailloux / BioDispersal

QGIS plugin to compute ecolgical continuities
GNU General Public License v3.0
7 stars 1 forks source link

MERGE STEP CRASH QGIS 3.28.13 #29

Open LudoPanfi opened 6 months ago

LudoPanfi commented 6 months ago

Hi everyone, I was working on my Biodispersal project but I had some problems. So I've started a new project with "BousquetOrb" files and I've followed video tutorials step by step, but merge step caused QGIS to crash anyway: "The plugin BioDispersal caused Qgis to crash. Please report this issue to the author of this plugin." Before reporting the issue, I copy the error appeared in the log tab:

LogTab_error

I copy here the report:

Report Details

Python Stack Trace

Windows fatal exception: access violation

Current thread 0x00003f90 (most recent call first):
  File "C:\Users/utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BioDispersal\qgis_lib_mc\feedbacks.py", line 196 in setProgressText
    QGuiApplication.processEvents()
  File "C:\Users/utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BioDispersal\steps\fusion.py", line 148 in applyItemsWithContext
    step_feedback.setProgressText("merging subnetwork " + st)
  File "C:\Users/utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BioDispersal\qgis_lib_mc\abstract_model.py", line 1189 in applyItems
    self.model.applyItemsWithContext(None,self.dlg.feedback,indexes)
  File "C:\Users/utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BioDispersal\BioDispersal.py", line 253 in run
    result = dlg.exec_()

Stack Trace


QgsCustomization::preNotify :
QObject::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
PyInit_QtCore :
PyArg_ParseTuple_SizeT :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyFloat_FromDouble :
PyVectorcall_Call :
PyObject_Call :
pdal::PointContainer::freeTemp :
pdal::Option::getName :
pdal::Option::getName :
PyArg_ParseTuple_SizeT :
PyEval_EvalFrameDefault :
PyObject_GC_Del :
PyFloat_FromDouble :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyFloat_FromDouble :
PyVectorcall_Call :
PyObject_Call :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
QObject::qt_static_metacall :
QAbstractButton::clicked :
QAbstractButton::click :
QAbstractButton::mouseReleaseEvent :
PyInit_QtWidgets :
QWidget::event :
PyInit_QtWidgets :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QDialog::exec :
PyInit_QtWidgets :
PyArg_ParseTuple_SizeT :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyFloat_FromDouble :
PyVectorcall_Call :
PyObject_Call :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
QObject::qt_static_metacall :
QAction::activate :
QAbstractButton::click :
QAbstractButton::mouseReleaseEvent :
QToolButton::mouseReleaseEvent :
QWidget::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info QGIS Version: 3.28.13-Firenze QGIS code revision: 3b4db4f561 Compiled against Qt: 5.15.3 Running against Qt: 5.15.3 Compiled against GDAL: 3.8.1 Running against GDAL: 3.8.1

System Info CPU Type: x86_64 Kernel Type: winnt Kernel Version: 10.0.19045

Waiting for a solution, thank you a lot!

MathieuChailloux commented 6 months ago

Hi, We have been experimenting a similar problem recently because of gdal merge algorithm. Can you try to merge 2 raster layers (for instance BioDispersal outputs) from gdal:merge processing algorithm ? And save result in a a file directly from gdal:merge interface ? Then tell me if this test has failed or not.

Regards, Mathieu

LudoPanfi commented 6 months ago

Hi Mathieu, thanks for your reply. So, I've done some merge tests using "raster miscellaneous > merge" command from GDAL Processing Toolbox on QGIS.

  1. First, I've tried to merge the 6 raster layers (land use, R1, R2, R3, rivers and railway lines): they are in Int16 format, so I put Int16 as well in the output format. It seems to work, but I can see only land use in the raster layer output. I report the algorithm here (sorry, it is in Italian language).

merge_test1

  1. Now, if in the merge tab I click on "Grab pseudolor table from first layer", the algorithm gives the same error of BioDispersal and the output layer is completely black. I report the algorithm again.

merge_error

merge_test2

What do yuo think about that? Actually, I don't really need to solve the merge step for my project. I need just step 7, the biodispersal one: is step 4 (merge) indispensable? Possibly, do you know if there is any QGIS version where there aren't these GDAL problems?

Thank you a lot.

Regards, Ludovica

katagen commented 4 months ago

I have the same problem here, also with the step "pondération". I need to use QGIS 3.16 to make the plugin works!

LudoPanfi commented 4 months ago

Thanks katagen!

I've tried to complete merge step with QGIS 3.4, 3.12 and 3.16 and the result is always the same: it works, but in every subnetwork (wetlands, forests, grasslands) I can't see rivers and roads, just land use! The order in the "rank layers" is the correct one (for example: rivers>railway>land use for grasslands subnetwork), but the merge file is incomplete. I've tried to go on with the friction step and it works, but, obviously, it doesn't care about rivers and roads.

Any ideas?

Regards, Ludovica

katagen commented 4 months ago

Your rivers must be larger then the resolution (pixel size) of your working project!

MathieuChailloux commented 4 months ago

@LudoPanfi Are your rivers and railway layers correctly rasterized at step 3 - Selection ?

LudoPanfi commented 4 months ago

Thanks! @katagen

Yes @MathieuChailloux, they're correctly rasterized at step 3. So, can I try to change the resolution? But maybe I must start from the first step...I can't change resolution just for the merge step, correctly?

MathieuChailloux commented 4 months ago

@LudoPanfi What you describe really look like a bad ranking but if you are sure it is correct I don't know. You can send me your data / project file to fdrmc@free.fr and I will check it out.

Regards

LudoPanfi commented 4 months ago

Thank you so much @MathieuChailloux, I'll send you my project file and my data by WeTransfer.

Regards

LudoPanfi commented 4 months ago

@MathieuChailloux
I've correctly completed merge and friction steps, so don't you waste your time opening my email. There was a problem with the coordinate system, but I've solved it. In the next days I'll go on with my project, I hope without any problem.

Thank you so much for your willingness. Regards,

oikami commented 3 weeks ago

@MathieuChailloux I have the same problem as reported above in QGIS 3.34.4 (Prizren): BioDispersal crashes at the merge step. I tried using gdal_merge on the output files of step 3 (Selection). As LudoPanfi already reported, gdal_merge fails with the same error message as BioDispersal if "Grab pseudolor table from first layer" is activated.

However: I can resolve this by setting the output format of gdal_merge to either Byte or UInt16. I can then transform the resulting file back to an Int16 without apparent loss of information.

I'm reporting this in the hope that my workaround might help resolving the issue for BioDispersal, too. It would be very helpful if BioDispersal were to run on newer QGIS versions again. For now I run it on QGIS3.22.4.

MathieuChailloux commented 3 weeks ago

Hi @oikami,

Thanks for this report, I will work on it very soon. If you have some time it would be helpful that you can show me this on your config as I can't reproduce this bug on mine.

Regards, Mathieu

oikami commented 2 weeks ago

@MathieuChailloux Thank you for your willingness to help! I've sent an e-mail to fdrmc@free.fr with my config and some information on my attempts at figuring out what's going wrong.