[QGIS-Developer] [Qgis-user] Wrong result with Saga Raster calculator

Pedro Venâncio pedrongvenancio at gmail.com
Wed May 31 13:16:12 PDT 2017


Hi Eugenio,

I've created a sample processing model (attached), that works ok, except a
small error in the result (decimals).

For instance:

*Raster* *ID* *Pixel value*
Z_top_res a 1202,03510276
t_top_res b 53,6123428345
topo c1 -182,584899902
SAGA Result 1 c 15,1783676147
SAGA Result 2 d 31,9437332153 *Diff*
Expected Result 1
15,1783679504 0,000000335741
Expected Result 2
31,9740872222 0,0303540069
*Formula*
1 ifelse(c1>0,-(0.0065*c1-16),(0.0045*c1+16))
2 ifelse(a<500,0,((b-c)/a)*1000)
Using SAGA GUI there is no error.

Could this be because of some roundings in the input / output? (I'm sending
for the developer's list also).

Thanks!

Best regards,
Pedro Venâncio



2017-05-31 10:56 GMT+01:00 Eugenio Trumpy <frippe12573 at hotmail.com>:

>
> Hi Pedro,
>
> thank you very much to have tested the computation with my test data!
> You are right, I checked again the computation and actually it works.
>
> However, I was using Saga raster calculation in a processing modeler, and
> one of the layer I share with you
> is the resulting from a previous computation.
>
> In other word the raster layer c=temp_recal.tif comes from a previous
> computation (raster calculator):
> ifelse(a>0,-(0.0065*a-16),(0.0045*a+16))
> where a is the layer attached, and hence c of the previous  formula is the
> resulting of this first computation.
>
> E.
>
> ------------------------------
> *Da:* Pedro Venâncio <pedrongvenancio at gmail.com>
> *Inviato:* mercoledì 31 maggio 2017 11:37
> *A:* frippe12573; qgis-user
> *Oggetto:* Re: [Qgis-user] Wrong result with Saga Raster calculator
>
> Hi Eugenio,
>
> The result with SAGA Raster Calculator seems ok here, on QGIS 2.18.9, SAGA
> 2.3.2, both from OSGeo4W64 (result attached).
>
> Z_top_res.tif have values from 724.403 to 1423.553, and so, the first
> condition is never true. Then, it always make ((b-c)/a)*1000, and the
> result seems ok to me.
>
>
> Pedro
>
>
>
> 2017-05-31 10:19 GMT+01:00 frippe12573 <frippe12573 at hotmail.com>:
>
>> Hi Paolo,
>>
>> the raster have the same size and origin.
>> The pixels are precisely overlapped.
>>
>> I tried also r.mapcalc, but I got a worst result.
>> Here the output of the log:
>> https://pastebin.com/jNyyzHgf
>>
>> E.
>>
>>
>>
>> --
>> View this message in context: http://osgeo-org.1560.x6.nabbl
>> e.com/Wrong-result-with-Saga-Raster-calculator-tp5322429p5322442.html
>> Sent from the QGIS - User mailing list archive at Nabble.com.
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170531/2fc5226a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: teste_saga_ifelse.model
Type: application/octet-stream
Size: 7903 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170531/2fc5226a/attachment.obj>


More information about the QGIS-Developer mailing list