[GRASSLIST:569]

Dear list,

so far, I have been masking either via MASK or r.mapcalc. This way, only cells corresponding to MASK would display in the masked raster.

In contrast, now I would like cells corresponding to a "mask" NOT to display* in the main raster layer. Is there a way to do it?

This is part of a larger issue I am addressing and that I will briefly describe. In the attached sample image, you see points imported via v.in.ascii and used to get the green interpolated raster. Values at black points are greater than zero, whereas the value of the white point is zero (and it is not used for interpolation since it has no biological meaning).

The end result would be to clip out a portion of the green raster around the white point. This portion would be delimited by midpoints between the white point and the closest neighboring black points.

So far, I have been trying to get a vector buffer around the white point and then v.to.rast for some kind of subsequent clipping (described above*). However I have no cue on how to get a comlex shape from neighboring points as described. Is there a method already in place to do this?

Many thanks in advance and any hints much appreciated,

Luigi

grass6/cygwin user
INFINITO ADSLFLAT 4 MEGA: SOLO 27,90 EURO AL MESE IVA INCLUSA IP STATICO, BANDA GARANTITA 256Kbps ANTIVIRUS E FIREWALL INCLUSI NEL PREZZO

http://adsl.infinito.it

(attachments)

sample.png

Il giorno mar, 04/04/2006 alle 19.50 +0200, lponti@infinito.it ha
scritto:

The end result would be to clip out a portion of the green
raster around the white point. This portion would be
delimited by midpoints between the white point and the
closest neighboring black points.

Not sure it would fit, but did you give a look at v.voronoi ?

HTH, Steko

--
Stefano Costa
http://www.iosa.it Software Open Source per l'Archeologia
Jabber: steko@jabber.linux.it
GnuPG Key ID 1024D/0xD0D30245
Linux Registered User #385969 counter.li.org

On Tue, 04 Apr 2006 19:50:34 +0200
lponti@infinito.it wrote:

Dear list,

so far, I have been masking either via MASK or r.mapcalc.
This way, only cells corresponding to MASK would display
in the masked raster.

In contrast, now I would like cells corresponding to a
"mask" NOT to display* in the main raster layer. Is there
a way to do it?

Not sure if I really got you right. But if all you need is to revert
mask, why not:

g.rename rast=MASK,mask_orig
g.region rast=mask_orig
r.mapcalc 'mask_rev=if(isnull(mask_orig),1,null())'
g.copy rast=mask_rev,MASK

(Assuming that your valid area in MASK is 1).

<snip>

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

Dear Maciek,

Yes! That was it. I actually wanted to write "reverse map" but I thought the term did not exist.

Thank you,

Luigi

On Tue, 4 Apr 2006 20:14:14 +0200
  Maciek Sieczka <werchowyna@epf.pl> wrote:

On Tue, 04 Apr 2006 19:50:34 +0200
lponti@infinito.it wrote:

Dear list,

so far, I have been masking either via MASK or r.mapcalc. This way, only cells corresponding to MASK would display in the masked raster.

In contrast, now I would like cells corresponding to a "mask" NOT to display* in the main raster layer. Is there a way to do it?

Not sure if I really got you right. But if all you need is to revert
mask, why not:

g.rename rast=MASK,mask_orig
g.region rast=mask_orig
r.mapcalc 'mask_rev=if(isnull(mask_orig),1,null())'
g.copy rast=mask_rev,MASK

(Assuming that your valid area in MASK is 1).

<snip>

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

INFINITO ADSLFLAT 4 MEGA: SOLO 27,90 EURO AL MESE IVA INCLUSA IP STATICO, BANDA GARANTITA 256Kbps ANTIVIRUS E FIREWALL INCLUSI NEL PREZZO

http://adsl.infinito.it

If white == 1 and black == 0 and you want all the "green" area
half-way between the white point and the black point, why don't you
try selecting all areas "green" >= 0.5?

Step 1: interpolate raster
Step 2: r.mapcalc "test = if(green >= 0.5, green, null())"

Alternatively, you could buffer the white points by some reasonable
distance and select for all cells within X meters of the white point.

David

On 4/4/06, lponti@infinito.it <lponti@infinito.it> wrote:

Dear list,

so far, I have been masking either via MASK or r.mapcalc.
This way, only cells corresponding to MASK would display
in the masked raster.

In contrast, now I would like cells corresponding to a
"mask" NOT to display* in the main raster layer. Is there
a way to do it?

This is part of a larger issue I am addressing and that I
will briefly describe. In the attached sample image, you
see points imported via v.in.ascii and used to get the
green interpolated raster. Values at black points are
greater than zero, whereas the value of the white point is
zero (and it is not used for interpolation since it has no
biological meaning).

The end result would be to clip out a portion of the green
raster around the white point. This portion would be
delimited by midpoints between the white point and the
closest neighboring black points.

So far, I have been trying to get a vector buffer around
the white point and then v.to.rast for some kind of
subsequent clipping (described above*). However I have no
cue on how to get a comlex shape from neighboring points
as described. Is there a method already in place to do
this?

Many thanks in advance and any hints much appreciated,

Luigi

grass6/cygwin user
INFINITO ADSLFLAT 4 MEGA: SOLO 27,90 EURO AL MESE IVA INCLUSA IP STATICO, BANDA GARANTITA 256Kbps ANTIVIRUS E FIREWALL INCLUSI NEL PREZZO

http://adsl.infinito.it

--
David Finlayson

Thanks David:
Your idea is something I had not thought to. The more I use GRASS, the better I appreciate r.mapcalc.

Thanks again Stefano:
I looked at v.voronoi and it seems to get exactly the buffer area I wanted. Voronoi polygons are also an interesting geometric concept that I did not know about.

Luigi

On Tue, 4 Apr 2006 22:58:21 -0700
  "David Finlayson" <david.p.finlayson@gmail.com> wrote:

If white == 1 and black == 0 and you want all the "green" area
half-way between the white point and the black point, why don't you
try selecting all areas "green" >= 0.5?

Step 1: interpolate raster
Step 2: r.mapcalc "test = if(green >= 0.5, green, null())"

Alternatively, you could buffer the white points by some reasonable
distance and select for all cells within X meters of the white point.

David

On 4/4/06, lponti@infinito.it <lponti@infinito.it> wrote:

Dear list,

so far, I have been masking either via MASK or r.mapcalc.
This way, only cells corresponding to MASK would display
in the masked raster.

In contrast, now I would like cells corresponding to a
"mask" NOT to display* in the main raster layer. Is there
a way to do it?

This is part of a larger issue I am addressing and that I
will briefly describe. In the attached sample image, you
see points imported via v.in.ascii and used to get the
green interpolated raster. Values at black points are
greater than zero, whereas the value of the white point is
zero (and it is not used for interpolation since it has no
biological meaning).

The end result would be to clip out a portion of the green
raster around the white point. This portion would be
delimited by midpoints between the white point and the
closest neighboring black points.

So far, I have been trying to get a vector buffer around
the white point and then v.to.rast for some kind of
subsequent clipping (described above*). However I have no
cue on how to get a comlex shape from neighboring points
as described. Is there a method already in place to do
this?

Many thanks in advance and any hints much appreciated,

Luigi

grass6/cygwin user
INFINITO ADSLFLAT 4 MEGA: SOLO 27,90 EURO AL MESE IVA INCLUSA IP STATICO, BANDA GARANTITA 256Kbps ANTIVIRUS E FIREWALL INCLUSI NEL PREZZO

http://adsl.infinito.it

--
David Finlayson

INFINITO ADSLFLAT 4 MEGA: SOLO 27,90 EURO AL MESE IVA INCLUSA IP STATICO, BANDA GARANTITA 256Kbps ANTIVIRUS E FIREWALL INCLUSI NEL PREZZO

http://adsl.infinito.it