mkoenigb / ProcessX

Repository for QGIS ProcessX Plug-In
GNU General Public License v3.0
3 stars 3 forks source link

QGIS Modeler Issue - Fails to create files properly #8

Closed astuartmiller closed 3 months ago

astuartmiller commented 3 months ago

image image image

When I run this as a temporary layer output it works fine. However, when I batch the process I get an error stating that the files were not created correctly. I am saving to a file path with no spaces, and have tried .shp and gpkg with the same results

mkoenigb commented 3 months ago

Not sure if this error is related to "count points in polygons with condition". At least the error you show does not indicate this.

Does it run fine if you replace "count points in polygons with condition" with the native "count points in polygon" algorithm?

astuartmiller commented 3 months ago

Not sure if this error is related to "count points in polygons with condition". At least the error you show does not indicate this.

Does it run fine if you replace "count points in polygons with condition" with the native "count points in polygon" algorithm?

The native count points in polygon was not producing errors, but with multiple points overlapping the counts were inaccurate. The only other change was adding "create spatial index" to increase the processing speed.

Its strange that it will run as a temporary layer with no issue, and when I converted the script to python it also produced no errors. If batch processing the script works I'll be able to move forward, thats great but I would like to know whats causing the issue in case there are problems down the line.

mkoenigb commented 3 months ago

Ok I can reproduce the issue. It does not only affect this algorithm but potentially all algorithms including all native algorithms. I assume there may be some bug in the model builder. Tested with 3.36.0 and native algorithms intersection and point to path.

For now I cannot see a cause for this in one of the algorithms from this plug in. I suggest to open a bug report in the official QGIS repository here: https://github.com/qgis/QGIS/issues

Please also review https://gis.stackexchange.com/questions/467219/attributeerror-in-qgis-model-during-batchmode-processing and the suggested solution to check "load layers on completion". For my tests this resolves the error.

astuartmiller commented 3 months ago

I really appreciate the quick response! That post has definitely helped, and I will keep it in mind going forward. I was really scratching my head on this.