Hi Yann, great to hear that you had at least some success. Hopefully the following info will help you narrow down the issue.
On Sun, Feb 18, 2018 at 2:45 PM, Yann Chemin <dr.yann.che...@gmail.com> wrote: > I conducted a GRASS GIS course this week and we found some bugs on > WinGRASS: > > r.mapcalc expression=if(case1,if(case2,Val2True,Val2False),Val1False)) > The example lacks the name of the map. Is this intentional? See suggestions in the manual page, maybe it will explain some details (note the differences to G6): https://grass.osgeo.org/grass74/manuals/r.mapcalc.html#program-use https://grass.osgeo.org/grass74/manuals/r.mapcalc.html#usage-from-command-line https://grass.osgeo.org/grass74/manuals/r.mapcalc.html#backwards-compatibility I don't know why the nested if statement/function would make any difference. What else you have tried? > > This expression will fail, note that the lack of quote is intentional, as > it is a requirement to run simpler r.mapcalc statements in WinGRASS. > I think quotes are basically required since spaces around equal sign are basically required. See the above links. Perhaps more explanation is needed in the manual. It explicitly talks about single quotes and unix, but not about Win or why (or why not double quotes). The things about equal sign and spaces were added by me to clarify the differences between G6 and G7 syntax, but I did not focus on the Win vs unix differences there. When in doubts on Win, there is always the GUI Map Calculator which accepts the right-hand side of the expression. On bug which is in GUI, which may or may not be reported, is that the history eats quotes from the command, so reusing the commands needs additional care. > > Also, we found that the use of || and && within a simple conditional > statement also did not process anything and failed. > We had issues in the past in our courses with running r.mapcalc commands on Win because of these, but recently, we had no issues and we settled on the following syntax (examples from class): r.mapcalc "elev_combined = if(y() < 224274. && x() > 637455., elevation, elev_srtm_30m)" r.mapcalc "low_elev_developed = if((elevation < 100 && elevation > 60) && (landuse96_28m == 1 || landuse96_28m == 2),1,null())" r.mapcalc "urban1_30m = if(landuse96_28m == 1,1,0) + if(landuse96_28m == 2,2,0)" Best, Vashek
_______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev