[GRASS-user] r.mapcalc problem ?

Excuse me if I seem stupid but I have a problem with r.mapcalc. I have a dem stored in FCELL with range of data(z) : min = -26.670000 max = 695.960022 . I try to extract a raster/dem with all values < 0.
I try
r.mapcalc ‘test = if(mydem >0.0000,mydem,null())’
Results give me
Range of datafor test : min = 0.200000 max = 695.960022
with r.mapcalc ‘test = if(mydem < 0.0000,mydem,null())’
results
Range of data: min = -26.670000 max = -0.010000 → ok for me
But when i display test map, i allways get the full dem and not only a map with values < 0.
I try replacing test with MASK but same result
What is the error I made or how can I do ?

Hi Martin

I think that your second command is correct. That is

r.mapcalc 'test = if(mydem < 0.0000,mydem,null())'

Probably your problem is that your are drawing the new map on top of the older one.
Just try to erase the monitor before drawing

d.mon start=x0
d.erase
d.rast test

Juan Carlos

Martin Laloux escribió:

Excuse me if I seem stupid but I have a problem with r.mapcalc. I have a dem stored in FCELL with range of data(z) : min = -26.670000 max = 695.960022 . I try to extract a raster/dem with all values < 0.
I try
r.mapcalc 'test = if(mydem >0.0000,mydem,null())'
Results give me
Range of datafor test : min = 0.200000 max = 695.960022 with r.mapcalc 'test = if(mydem < 0.0000,mydem,null())'
results
Range of data: min = -26.670000 max = -0.010000 -> ok for me
But when i display test map, i allways get the full dem and not only a map with values < 0.
I try replacing test with MASK but same result
What is the error I made or how can I do ?

------------------------------------------------------------------------

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
  

Juan Carlos Torres wrote:

I think that your second command is correct. That is

r.mapcalc 'test = if(mydem < 0.0000,mydem,null())'

Probably your problem is that your are drawing the new map on top of the
older one.
Just try to erase the monitor before drawing

Or use "d.rast -n ...", which will draw null cells.

--
Glynn Clements <glynn@gclements.plus.com>

Juan CT:

> I think that your second command is correct. That is

> r.mapcalc 'test = if(mydem < 0.0000,mydem,null())'
>
> Probably your problem is that your are drawing the new map on top of the
> older one. Just try to erase the monitor before drawing

Glynn C:

Or use "d.rast -n ...", which will draw null cells.

Ehm... where is this flag (-n) ? In grass70?
Thanks, Nikos

Hi,

2009/7/4 Nikos Alexandris <nikos.alexandris@felis.uni-freiburg.de>:

Glynn C:

Or use "d.rast -n ...", which will draw null cells.

Ehm... where is this flag (-n) ? In grass70?

yes,

  -n Make null cells opaque

in GRASS7 null cells are displayed transparent by default (in GRASS6
you have to use '-o' flag for that).

Martin

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

Glynn:

>> Or use "d.rast -n ...", which will draw null cells.

Nikos:

> Ehm... where is this flag (-n) ? In grass70?

Martin:

yes,
  -n Make null cells opaque

in GRASS7 null cells are displayed transparent by default (in GRASS6
you have to use '-o' flag for that).

So it's just that "-o" changed to "-n" (?).
Thanks, Nikos

Hi,

2009/7/4 Nikos Alexandris <nikos.alexandris@felis.uni-freiburg.de>:

[...]

yes,
-n Make null cells opaque

in GRASS7 null cells are displayed transparent by default (in GRASS6
you have to use '-o' flag for that).

So it's just that "-o" changed to "-n" (?).

-o has opposite meaning of -n

See

-o Overlay (non-null values only)

I.e. in GRASS7 are null values displayed opaque by default.

Martin

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

2009/7/4 Martin Landa <landa.martin@gmail.com>:

[...]

I.e. in GRASS7 are null values displayed opaque by default.

s/GRASS7/GRASS6/g

Martin

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