Re: [Qgis-user] how to fix the raster calculator

2019-09-26 Thread Raymond Nijssen


On 26-09-19 18:07, Alessandro Pasotti wrote:

Hi Raymond,

Working on it (I've been able to reproduce it), can you please file a 
ticket for me to reference in the PR?


Done: https://github.com/qgis/QGIS/issues/32025




Somehow this was fixed after changing the locale (!) from NL back to
EN.


This looks completely impossible to me: there is no locale involved in 
the formulas (and no translation of operators!).


Maybe the restart after changing the locale has triggered something else.




Yes, you missed the implementation :)

Nobody had already implemented it, but I've done that today.


Nice! \o/




--
Alessandro Pasotti
w3: www.itopen.it 

___
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

Re: [Qgis-user] how to fix the raster calculator

2019-09-26 Thread Alessandro Pasotti
On Tue, Sep 24, 2019 at 12:19 PM Raymond Nijssen 
wrote:

> Hi,
>
> I've been using the raster calculator lately and bumped into some
> unexpected behaviour issues. They are hard to isolate but I will create
> issues
>
> One of the things is the creation of empty output grids, resulting in
> raster layers with a range as described earlier in this thread:
>
> ([-1.79769e+308 to 1.79769e+308] instead of [0 1].
>

Hi Raymond,

Working on it (I've been able to reproduce it), can you please file a
ticket for me to reference in the PR?


>
> Somehow this was fixed after changing the locale (!) from NL back to EN.
>

This looks completely impossible to me: there is no locale involved in the
formulas (and no translation of operators!).

I was using a model that contained raster calculators and a python
> script running it.
> No clue what it could be, maybe parameter names being translated (I hope
> not!) or locale settings for decimal point/comma.
>
> Also, the names of the model parameter are like
> 'qgis:rastercalculator_4:sub_calc_sqrt', still containing the
> 'rastercalculator_4' part which can not be found or changed using the
> model editor.
>
>
> Besides, I'm wondering why very common functionality is missing in the
> raster calculator. I need abs() and max() functions and they don't
> exist. Or am I missing something?
>

Yes, you missed the implementation :)

Nobody had already implemented it, but I've done that today.


-- 
Alessandro Pasotti
w3:   www.itopen.it
___
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

Re: [Qgis-user] how to fix the raster calculator

2019-09-24 Thread Áron Gergely

Hi Raymond and list,

I think your first issue may have been caused by the decimal character 
in your formula not matching the locale;

Can be a point '.' or comma ','

I also use the 'high school math' methods you mentioned ;) I am not 
aware of any tricks.
Would be nice to have convenience functions for abs(), max(), mean(), 
stdev(), etc..


As a workaround you can use the GDAL raster calculator, I think abs() 
and similar are implemented there.


If anyone is aware of any QGIS raster calculator tricks I would be eager 
to learn about them as well.


Best Regards,
Aron

On 24/09/2019 12:19, Raymond Nijssen wrote:

Hi,

I've been using the raster calculator lately and bumped into some 
unexpected behaviour issues. They are hard to isolate but I will 
create issues


One of the things is the creation of empty output grids, resulting in 
raster layers with a range as described earlier in this thread:


([-1.79769e+308 to 1.79769e+308] instead of [0 1].

Somehow this was fixed after changing the locale (!) from NL back to 
EN. I was using a model that contained raster calculators and a python 
script running it.
No clue what it could be, maybe parameter names being translated (I 
hope not!) or locale settings for decimal point/comma.


Also, the names of the model parameter are like 
'qgis:rastercalculator_4:sub_calc_sqrt', still containing the 
'rastercalculator_4' part which can not be found or changed using the 
model editor.



Besides, I'm wondering why very common functionality is missing in the 
raster calculator. I need abs() and max() functions and they don't 
exist. Or am I missing something?


My solutions / work arounds using creative high school math are:

abs(a):
sqrt(a * a)
or
((a >= 0) * a) + ((a < 0) * -1 * a)

max(a, b):
((a >= b) * a) + ((a < b) * b)


Hope someone has a clue here. Guess I'm not the only one using vector 
more often than raster...


Kind regards,
Raymond



On 21-03-19 17:19, shalum HOUENOU wrote:

OK then

Maixent,

*De : *matteo <mailto:matteo.ghe...@gmail.com>
*Envoyé le :*jeudi 21 mars 2019 17:14
*À : *shalum HOUENOU <mailto:shalumhoue...@gmail.com>
*Objet :*Re: [Qgis-user] how to fix the raster calculator

please answer to all (so you question is forwarded also to the user

mailing list)

I think then the raster calculator has a bug. Could you please report 
it?


https://issues.qgis.org/projects/qgis

or try to upgrade to QGIS 3.6

On 3/21/19 5:13 PM, shalum HOUENOU wrote:

 >

 >

 > Yes I did, as it was mentionned in the training manual, section 8.3.7

 >

 > You have the link below :

 >

 > 
https://docs.qgis.org/testing/en/docs/training_manual/rasters/terrain_analysis.html#moderate-fa-using-the-raster-calculator


 >

 >

 >

 > Maixent,

 >

 > *De : *matteo <mailto:matteo.ghe...@gmail.com>

 > *Envoyé le :*jeudi 21 mars 2019 17:07

 > *À : *shalum HOUENOU <mailto:shalumhoue...@gmail.com>;

 > qgis-it-user-ow...@lists.osgeo.org

 > <mailto:qgis-it-user-ow...@lists.osgeo.org>

 > *Objet :*Re: [Qgis-user] how to fix the raster calculator

 >

 >

 >

 > Hi Maixent,

 >

 >

 >

 >

 >

 >> Indeed the boundaries of my output layer have Strange values

 >

 >> ([-1.79769e+308 to 1.79769e+308] instead of [0 1].

 >

 >>

 >

 >> Thus the output layer is invisible.

 >

 >>

 >

 >> I’ve already tried to change the max and the min value : The 
layer is


 >

 >> still invisible.

 >

 >>

 >

 >> What else could I do to fix it ? Any idea ?

 >

 >

 >

 > did you also set the reference layer in the algorithm UI?

 >

 >

 >

 > Matteo

 >

 >

 >


___
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


___
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


___
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

Re: [Qgis-user] how to fix the raster calculator

2019-09-24 Thread Raymond Nijssen

Hi,

I've been using the raster calculator lately and bumped into some 
unexpected behaviour issues. They are hard to isolate but I will create 
issues


One of the things is the creation of empty output grids, resulting in 
raster layers with a range as described earlier in this thread:


([-1.79769e+308 to 1.79769e+308] instead of [0 1].

Somehow this was fixed after changing the locale (!) from NL back to EN. 
I was using a model that contained raster calculators and a python 
script running it.
No clue what it could be, maybe parameter names being translated (I hope 
not!) or locale settings for decimal point/comma.


Also, the names of the model parameter are like 
'qgis:rastercalculator_4:sub_calc_sqrt', still containing the 
'rastercalculator_4' part which can not be found or changed using the 
model editor.



Besides, I'm wondering why very common functionality is missing in the 
raster calculator. I need abs() and max() functions and they don't 
exist. Or am I missing something?


My solutions / work arounds using creative high school math are:

abs(a):
sqrt(a * a)
or
((a >= 0) * a) + ((a < 0) * -1 * a)

max(a, b):
((a >= b) * a) + ((a < b) * b)


Hope someone has a clue here. Guess I'm not the only one using vector 
more often than raster...


Kind regards,
Raymond



On 21-03-19 17:19, shalum HOUENOU wrote:

OK then

Maixent,

*De : *matteo <mailto:matteo.ghe...@gmail.com>
*Envoyé le :*jeudi 21 mars 2019 17:14
*À : *shalum HOUENOU <mailto:shalumhoue...@gmail.com>
*Objet :*Re: [Qgis-user] how to fix the raster calculator

please answer to all (so you question is forwarded also to the user

mailing list)

I think then the raster calculator has a bug. Could you please report it?

https://issues.qgis.org/projects/qgis

or try to upgrade to QGIS 3.6

On 3/21/19 5:13 PM, shalum HOUENOU wrote:

 >

 >

 > Yes I did, as it was mentionned in the training manual, section 8.3.7

 >

 > You have the link below :

 >

 > 
https://docs.qgis.org/testing/en/docs/training_manual/rasters/terrain_analysis.html#moderate-fa-using-the-raster-calculator


 >

 >

 >

 > Maixent,

 >

 > *De : *matteo <mailto:matteo.ghe...@gmail.com>

 > *Envoyé le :*jeudi 21 mars 2019 17:07

 > *À : *shalum HOUENOU <mailto:shalumhoue...@gmail.com>;

 > qgis-it-user-ow...@lists.osgeo.org

 > <mailto:qgis-it-user-ow...@lists.osgeo.org>

 > *Objet :*Re: [Qgis-user] how to fix the raster calculator

 >

 >

 >

 > Hi Maixent,

 >

 >

 >

 >

 >

 >> Indeed the boundaries of my output layer have Strange values

 >

 >> ([-1.79769e+308 to 1.79769e+308] instead of [0 1].

 >

 >>

 >

 >> Thus the output layer is invisible.

 >

 >>

 >

 >> I’ve already tried to change the max and the min value : The layer is

 >

 >> still invisible.

 >

 >>

 >

 >> What else could I do to fix it ? Any idea ?

 >

 >

 >

 > did you also set the reference layer in the algorithm UI?

 >

 >

 >

 > Matteo

 >

 >

 >


___
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


___
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

Re: [Qgis-user] how to fix the raster calculator

2019-03-21 Thread shalum HOUENOU
OK then
Maixent,
De : matteo
Envoyé le :jeudi 21 mars 2019 17:14
À : shalum HOUENOU
Objet :Re: [Qgis-user] how to fix the raster calculator

please answer to all (so you question is forwarded also to the user
mailing list)

I think then the raster calculator has a bug. Could you please report it?

https://issues.qgis.org/projects/qgis

or try to upgrade to QGIS 3.6

On 3/21/19 5:13 PM, shalum HOUENOU wrote:
>  
> 
> Yes I did, as it was mentionned in the training manual, section 8.3.7
> 
> You have the link below :
> 
> https://docs.qgis.org/testing/en/docs/training_manual/rasters/terrain_analysis.html#moderate-fa-using-the-raster-calculator
> 
>  
> 
> Maixent,
> 
> *De : *matteo <mailto:matteo.ghe...@gmail.com>
> *Envoyé le :*jeudi 21 mars 2019 17:07
> *À : *shalum HOUENOU <mailto:shalumhoue...@gmail.com>;
> qgis-it-user-ow...@lists.osgeo.org
> <mailto:qgis-it-user-ow...@lists.osgeo.org>
> *Objet :*Re: [Qgis-user] how to fix the raster calculator
> 
>  
> 
> Hi Maixent,
> 
>  
> 
>  
> 
>> Indeed the boundaries of my output layer have Strange values
> 
>> ([-1.79769e+308 to 1.79769e+308] instead of [0 1].
> 
>>
> 
>> Thus the output layer is invisible.
> 
>>
> 
>> I’ve already tried to change the max and the min value : The layer is
> 
>> still invisible.
> 
>>
> 
>> What else could I do to fix it ? Any idea ?
> 
>  
> 
> did you also set the reference layer in the algorithm UI?
> 
>  
> 
> Matteo
> 
>  
> 

___
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

Re: [Qgis-user] how to fix the raster calculator

2019-03-21 Thread Alister Hood
>
> Hi all,
> I'm using a QJIS 3.4 under window 10.
> I have issue with the raster calculator tool located in raster analysis
> section of the processing tool.
> After calculations the output layers are not visible no matter the data i'm
> using.
> I've already uninstall and reinstall the software and it is still doing the
> same thing.
> How could I fix it?
> Thanks for your advices
> --
> Regards,
> Maixent
>

Hi, try 3.6 - you might find it works fine.  It was very buggy in previous
versions, including 3.4, although I'm not sure if it is fixed in the latest
version of 3.4

Regards,
Alister

>
___
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

Re: [Qgis-user] how to fix the raster calculator

2019-03-21 Thread matteo
Hi Maixent,

> Hi all,
> I'm using a QJIS 3.4 under window 10. 
> I have issue with the raster calculator tool located in raster analysis
> section of the processing tool.
> After calculations the output layers are not visible no matter the data
> i'm using.
> I've already uninstall and reinstall the software and it is still doing
> the same thing.
> How could I fix it?
> Thanks for your advices

is the result not visible or does it have "strange" values? If so, try
to go in the layer style panel and change the min and max values

Cheers

Matteo
___
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

[Qgis-user] how to fix the raster calculator

2019-03-21 Thread shalum HOUENOU
Hi all,
I'm using a QJIS 3.4 under window 10.
I have issue with the raster calculator tool located in raster analysis
section of the processing tool.
After calculations the output layers are not visible no matter the data i'm
using.
I've already uninstall and reinstall the software and it is still doing the
same thing.
How could I fix it?
Thanks for your advices
-- 
Regards,
Maixent
___
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