[GRASS-dev] g.region b>t fixed (?)

Hi all,

I have tried to fix b > t g.region bug. Do you think that -p|-p3 flag
should also print information about number of cells/3dcells. It may be
useful information -- from user point of view...

Current behaviour:

GRASS 6.1.cvs (spearfish60):~ >
g.region -d

g.region res3=100 b=100 t=0 -p3
...
tbres: -inf
...
depths: 0

g.region -p3
ERROR: region for current mapset is invalid
       line 15: <depths: 0>
       run "g.region"

or

g.region -d

g.region t=100 b=0 tbres=500 -p3
...
tbres: inf
...
depths: 0
...

g.region -p3
ERROR: region for current mapset is invalid
       line 15: <depths: 0>
       run "g.region"

After patching

g.region -d

g.region res3=100 b=100 t=0 -p3
ERROR: Invalid region: Top must be larger than Bottom

g.region -p3
...
top: 1.00000000
bottom: 0.00000000
...
tbres: 1
...
depths: 1
cells: 302418
3dcells: 302418

g.region -d

g.region t=100 b=0 tbres=500 -p3
...
top: 100.00000000
bottom: 0.00000000
...
tbres: 100
...
depths: 1
cells: 302418
3dcells: 302418

If you find the patch useful, please commit it to CVS, thanks.

Best regards, Martin

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *

(attachments)

g_region_tb-cells.diff.gz (1.62 KB)