[GRASS-user] v.to.rast, r.to.vect, "stable" transformation
Moritz Lennert
mlennert at club.worldonline.be
Mon Feb 6 07:31:10 EST 2012
On 06/02/12 12:46, Johannes Radinger wrote:
> The r.thin process is an important step (as recommended also in the
> manual) and should not be skipped at all!
In general, I agree with you, but I'm not sure that v.to.rast +
r.to.vect would profit of r.thin in the middle, since v.to.rast already
should provide a thinned line. AFAIU r.thin is useful when you have
raster lines produced by something else than v.to.rast.
> Maybe I just see something wrong..anyway i thought about testing the
> stability in a loop, but I got stucked in the correct map calc
> operation. What is the correct (boolean) operator to get:
>
> 1) NULL + NULL = NULL
> 2) not NULL + not NULL = NULL
> 3) not NULL + NULL = 1
> 4) NULL + not NULL = 1
How about (untested):
if( (isnull(A) && isnull(B)) || (!isnull(A) && !isnull(B)), null(), 1)
Moritz
More information about the grass-user
mailing list