<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hello everyone</div>

<div> </div>

<div>I am not sure how to close a request to you again. </div>

<div> </div>

<div>Meanwhile I found the error in the code section myself. The names of the parameters are not e.g. <span style="background-color:#ffff00;">'AVG '</span> as specified in the QGIS module logfile, instead they are <span style="background-color:#ffff00;">'AVG             '</span> (note the long 13 space after the G) as specified in the QGIS history. </div>

<div> </div>

<div>Hence the correct code for this module would be as follows:</div>

<div>processing.run("saga:pointstatisticsforpolygons", {'POINTS':'C:/[...]Test_points.shp','POLYGONS':'C:/[...]/Test_Polygons.shp','FIELDS':'VALUE','FIELD_NAME':3,'SUM             ':True,'AVG             ':True,'VAR             ':True,'DEV             ':True,'MIN             ':True,'MAX             ':True,'NUM             ':True,'STATISTICS':'C:/[...]/Test_Output.shp'})</div>

<div> </div>

<div>Best,</div>

<div><strong>Anna</strong></div>

<div> 
<div> 
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Dienstag, 08. November 2022 um 13:17 Uhr<br/>
<b>Von:</b> "QGIS4you2--- via Qgis-user" <qgis-user@lists.osgeo.org><br/>
<b>An:</b> qgis-user@lists.osgeo.org<br/>
<b>Betreff:</b> [Qgis-user] Parameter Inputs (False/True) for SAGA: 'Point statistics for polygon' module is not passed correctly in QGIS python console</div>

<div name="quoted-content">
<div style="font-family: Verdana;font-size: 12.0px;">
<div> </div>

<div class="signature">Hello everyone</div>

<div class="signature"> </div>

<div class="signature">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). </div>

<div class="signature"> </div>

<div class="signature">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.</div>

<div class="signature"> </div>

<div class="signature"><strong>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. </strong></div>

<div class="signature"> </div>

<div class="signature">My Python code:</div>

<div class="signature">Note: For clarity, I shortened below the file paths with [...].</div>

<div class="signature"> </div>

<div class="signature">>>>from qgis import processing</div>

<div class="signature">>>>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}) </div>

<div class="signature"> </div>

<div class="signature"><strong>Does anyone have an idea what the reason for this behavior could be? And how can I solve this problem?</strong> (Other modules (non-SAGA) are executed correctly via the Python Console).</div>

<div class="signature">If not, is there a way to change the default setting in SAGA?</div>

<div class="signature"> </div>

<div class="signature">Thanks for your help.</div>

<div class="signature">Anna</div>

<div class="signature"> </div>
</div>
_______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></div>
</div>
</div>
</div></div></body></html>