Hi devs,
sorry to bother…
Can anybody please share a .gxm file with an example for using r.mapcalc in a loop in the g.gui.gmodeler? I was able to do simple stuff with loops and say r.info or r.stats, but just can’t figure out the way to do even a simple operation with r.mapcalc in a loop… maybe too tired already…
I also found this video, but it is for grass 6 and does not use loops: https://www.youtube.com/watch?v=jaMyFQholMQ
Thanks much in advance!
Cheers,
Vero
On 4 November 2015 at 04:55, Veronica Andreo <veroandreo@gmail.com> wrote:
Hi devs,
Hi,
sorry to bother...
Can anybody please share a .gxm file with an example for using r.mapcalc in
a loop in the g.gui.gmodeler? I was able to do simple stuff with loops and
say r.info or r.stats, but just can't figure out the way to do even a simple
operation with r.mapcalc in a loop... maybe too tired already...
here you are... please if you are able, provide some documentation for
g.gui.gmodeler, it is really needed
I also found this video, but it is for grass 6 and does not use loops:
https://www.youtube.com/watch?v=jaMyFQholMQ
Thanks much in advance!
Cheers,
Vero
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
(attachments)
test.gxm (6.91 KB)
Ciao Luca!
Thanks for the example!
Did it work for you?? When I try to validate it, I get
Model is not valid.
r.mapcalc: undefined variable ‘ndvi * 0.0001’
whatever operation I write in the right part of the expression.
The only thing that gives me a valid model is %map = %map.
Can anybody explain how it should be done or what are we missing there, please???
I really need this for a GUI based course I have to teach next week (students use windows and know nothing of programming). Any other suggestion is more than welcome!
Cheers,
Vero
···
2015-11-04 4:53 GMT-03:00 Luca Delucchi <lucadeluge@gmail.com>:
On 4 November 2015 at 04:55, Veronica Andreo <veroandreo@gmail.com> wrote:
Hi devs,
Hi,
sorry to bother…
Can anybody please share a .gxm file with an example for using r.mapcalc in
a loop in the g.gui.gmodeler? I was able to do simple stuff with loops and
say r.info or r.stats, but just can’t figure out the way to do even a simple
operation with r.mapcalc in a loop… maybe too tired already…
here you are… please if you are able, provide some documentation for
g.gui.gmodeler, it is really needed
I also found this video, but it is for grass 6 and does not use loops:
https://www.youtube.com/watch?v=jaMyFQholMQ
Thanks much in advance!
Cheers,
Vero
–
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
On 4 November 2015 at 16:58, Veronica Andreo <veroandreo@gmail.com> wrote:
Ciao Luca!
ciao vero,
Thanks for the example!
Did it work for you?? When I try to validate it, I get
with a small workaround yes
Model is not valid.
r.mapcalc: undefined variable 'ndvi * 0.0001'
I got the same
whatever operation I write in the right part of the expression.
The only thing that gives me a valid model is %map = %map.
but this is not correct... there are some bugs in the modeler [0]
Can anybody explain how it should be done or what are we missing there,
please???
nothing, but to have the script working properly you have to modify
the code from Python editor, you have to remove the wrong quotes [0],
and I have to obtain something similar to the attached python script.
I really need this for a GUI based course I have to teach next week
(students use windows and know nothing of programming). Any other suggestion
is more than welcome!
Next week? You have plenty of time, I learned the Modeler (and how to
fix problems) in one night, so relax your self
Cheers,
Vero
[0] https://trac.osgeo.org/grass/ticket/2782
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
(attachments)
test.py (4.85 KB)