Hello everyone
 
I work mostly with QGIS 3.18 (SAGA 2.3.2), but the problem also exists in QGIS 3.22 (SAGA 7.8.2) and QGIS 3.28 (SAGA 7.8.2). 
 
If I run the SAGA module 'Point statistics for polygon' via the QGIS Processing Toolbox and check the calculation of Sum, Mean (= AVG), Variance (= VAR), Deviation (= DEV), Minimum, Maximum and Count (= NUM), these values are displayed in the output shp file.
 
If I do the same with the Python Console (same settings, same layer, same output layer) the inputs (True/False) for Sum, Mean, Variance, Deviation, Minimum, Maximum and Count are ignored and just the SAGA default setting (AVG = True, everything else = False) is executed for this module. Furthermore, the command is executed without error. 
 
My Python code:
Note: For clarity, I shortened below the file paths with [...].
 
>>>from qgis import processing
>>>processing.run('saga:pointstatisticsforpolygons', {'AVG ' : True, 'DEV ' : True, 'FIELDS' : 'VALUE', 'FIELD_NAME' : 3, 'MAX ' : True, 'MIN ' : True, 'NUM ' : True, 'POINTS' : 'C:/[...]Test_points.shp', 'POLYGONS' : 'C:/[...]/Test_Polygons.shp', 'STATISTICS' : 'C:/[...]/Test_Output.shp', 'SUM ' : True, 'VAR ' : True}) 
 
Does anyone have an idea what the reason for this behavior could be? And how can I solve this problem? (Other modules (non-SAGA) are executed correctly via the Python Console).
If not, is there a way to change the default setting in SAGA?
 
Thanks for your help.
Anna
 
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to