<html style="direction: ltr;">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body style="direction: ltr;"
bidimailui-detected-decoding-type="UTF-8" text="#000000"
bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Luciano:<br>
<br>
Keeping the discussion on the grass-users list<br>
<br>
On 11/7/2012 10:57 PM, Luciano La Sala wrote:<br>
</div>
<blockquote cite="mid:003401cdbd2a$7eb04610$7c10d230$@com.ar"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="MS Exchange Server version
08.00.0681.000">
<title>Still in trouble</title>
<!-- Converted from text/rtf format -->
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"><font
face="Consolas"><br>
</font></span><span lang="es-ar"></span><span lang="en-us"> </span></p>
<p dir="LTR"><span lang="en-us"></span><span lang="es-ar"></span><span
lang="en-us"> </span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">I tried both
options</font></span><span lang="es-ar"></span><span
lang="en-us"><font face="Consolas"> (your message below)</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">;
i.e. reverting back to vectors and</font></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">multiply</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">ing</font></span><span
lang="es-ar"></span><span lang="en-us"></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">my</font></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">risk
raster by</font></span><span lang="es-ar"></span><span
lang="en-us"> <font face="Consolas">a</font></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">constant</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">
(in this case</font></span><span lang="es-ar"></span><span
lang="en-us"> <font face="Consolas">1000</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">)</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">
to get integer </font></span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"><font
face="Consolas">v</font></span><span lang="es-ar"></span><span
lang="en-us"><font face="Consolas">alues</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">
which "r.surf.idw" is capable of dealing with. Option 1 does
not work, and I don't know why. Option 2 seemed more
intuitive and simple... </font></span></p>
<br>
</blockquote>
<br>
<font face="Consolas">(clipped)</font><br>
<blockquote cite="mid:003401cdbd2a$7eb04610$7c10d230$@com.ar"
type="cite">
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"><font
face="Consolas">Then run r.surf.idw on that and</font></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">I
get Screen_03, the weirdest map ever!</font></span></p>
</blockquote>
<p><br>
</p>
<p><font face="Consolas">I think you've done everything right. One
detail you might not be aware of: the r.surf.* modules will
always work in the full "current computational region". So
interpolation continues, as best as it can, right to the edge of
the region, creating those funny looking angles and spikes
outside of argentina.</font></p>
<p><font face="Consolas">The way to do this is create a mask raster.
In GRASS you can limit almost all raster command to any
arbitrary area by using a mask. So:</font></p>
<p><font face="Consolas">1- take a vector polygon of the whole
country, and import it into GRASS. </font></p>
<p><font face="Consolas">2- Then use "v.to.rast argentina_poly
type=area use=val value=1 out=argentina_rast" to convert it to a
raster. </font></p>
<p><font face="Consolas">3- Next set this argentina raster as the
MASK with "r.mask argentina_rast"</font></p>
<p><font face="Consolas">4- and now rerun the interpolation</font></p>
<p><br>
</p>
<blockquote cite="mid:003401cdbd2a$7eb04610$7c10d230$@com.ar"
type="cite">
<p dir="LTR"><span lang="en-us"><font face="Consolas"> </font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">Finally, I</font></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">divide
the result by 1000</font></span><span lang="es-ar"></span><span
lang="en-us"><font face="Consolas">.0</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">
again</font></span><span lang="es-ar"></span><span
lang="en-us"><font face="Consolas"> (not 1000, like you said,</font></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">to
insure that the result is</font></span><span lang="es-ar"></span><span
lang="en-us"> <font face="Consolas">a</font></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">floating
point</font></span><span lang="es-ar"></span><span
lang="en-us"><font face="Consolas">)</font></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">to
get back to</font></span><span lang="es-ar"></span><span
lang="en-us"><font face="Consolas"> my</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">
normalized values</font></span><span lang="es-ar"></span><span
lang="en-us"><font face="Consolas">, but the same weird raster
map remains (Screen_04).</font></span></p>
</blockquote>
<p><br>
</p>
<p><font face="Consolas">Check the values you got with r.info. </font></p>
<p><br>
</p>
<blockquote cite="mid:003401cdbd2a$7eb04610$7c10d230$@com.ar"
type="cite">
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">Where</font></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">is
it that I am going so wrong? To do al</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">l</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">
this I didn</font></span><span lang="es-ar"></span><span
lang="en-us"><font face="Consolas">’</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">t
use QGIS, so I am not referring the message to</font></span><span
lang="es-ar"></span><span lang="en-us"> <font face="Consolas">t</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">he</font></span><span
lang="es-ar"></span><span lang="en-us"><font face="Consolas">
list.</font></span><span lang="es-ar"></span><span
lang="en-us"> </span><span lang="es-ar"></span><span
lang="en-us"> </span><span lang="es-ar"></span><span
lang="en-us"> </span><span lang="es-ar"></span><span
lang="en-us"> </span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"></span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"><font
face="Consolas">Very best,</font></span><span lang="es-ar"></span><span
lang="en-us"> </span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">Luciano</font></span><span
lang="es-ar"></span><span lang="en-us"> </span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"></span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"><font
face="Arial" size="2" color="#000000"> <<...>> </font></span><span
lang="en-us"></span><span lang="en-us"></span><span
lang="es-ar"></span><span lang="es-ar"></span><span
lang="en-us"><font face="Arial" size="2" color="#000000">
<<...>> </font></span><span lang="en-us"></span><span
lang="en-us"></span><span lang="es-ar"></span><span
lang="es-ar"></span><span lang="en-us"><font face="Arial"
size="2" color="#000000"> <<...>> </font></span><span
lang="en-us"></span><span lang="en-us"></span><span
lang="es-ar"></span><span lang="es-ar"></span><span
lang="en-us"><font face="Arial" size="2" color="#000000">
<<...>> </font></span><span lang="en-us"></span><span
lang="en-us"></span><span lang="es-ar"></span><span
lang="en-us"></span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"></span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="es-ar"><font
face="Consolas">-----Mensaje original-----<br>
De: Micha Silver [</font></span><span lang="es-ar"></span><a
moz-do-not-send="true" href="mailto:micha@arava.co.il"><span
lang="es-ar"></span><u><span lang="es-ar"><font
face="Consolas" color="#0000FF">mailto:micha@arava.co.il</font></span></u><span
lang="es-ar"></span></a><span lang="es-ar"></span><span
lang="es-ar"><font face="Consolas">]<br>
Enviado el: Tuesday, November 06, 2012 6:20 AM<br>
</font></span><span lang="es-ar"></span><span lang="es"><font
face="Consolas">Para: Luciano La Sala<br>
CC: grass-user<br>
Asunto: [Bulk] Re: [Bulk] Re: Two simple questions</font></span><span
lang="es-ar"></span></p>
<p dir="LTR"><span lang="es-ar"></span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"><font
face="Consolas">Hi Luciano:</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">(Returning
to the maillist - maybe this will help others...)</font></span></p>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">On
05/11/2012 18:29, Luciano La Sala wrote:</font></span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"><font
face="Consolas">> Two simple questions</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> Thank
you Micha, I found the icons right under my nose.</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> To tell
you the truth I am kind of lost here. I am trying to do the
</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
interpolation from within QGIS using the raster map of risk
I did </font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
following your instructions (JPEG attached).</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> Pixel
values, as calculated using the “r.mapcalculator” module in
</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> GRASS,
are (from the lightest yellow to the darkest red):</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> 0.0406</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> 0.1422</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> 0.4268</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> 0.5284</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> 0.7154</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> 0.8983</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> I first
used the module “r.surf.idw” module (Screen_01) which runs </font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
successfully but produces an entirely black raster map as
output </font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
(Screen_02). All the pixels of this raster contain a value
of 1.</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> There
is obviously something wrong here. Any tips? Should I use </font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
“v.surf.idw” instead?</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">I found on
an old maillist post that r.surf.idw works only with integer
values. That's why you're getting everything "rounded" to 1.
To work around this, you can try two options:</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">* revert
back to vectors, as you suggest. (v.surf.idw accepts decimal</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">values)</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">
r.to.vect -z in=risk_raster out=risk_vector feature=point</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">
v.surf.idw in=risk_vector out=risk_idw layer=0</font></span></p>
<br>
<p dir="LTR"><span lang="en-us"><font face="Consolas">OR</font></span></p>
<br>
<p dir="LTR"><span lang="en-us"><font face="Consolas">* multiply
your risk raster by some constant, say 1000, to get integer
</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">values. Then
run r.surf.idw on that, and divide the result by the same </font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">1000 again
to get back to your normalized values.</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">
r.mapcalc risk_integer=risk_raster*1000</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">
r.surf.idw in=risk_integer out=risk_idw_tmp</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">
r.mapcalc risk_idw=risk_idw_tmp/1000.0</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas"> # Use
the decimal value 1000.0 to insure that the result is </font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">floating
point.</font></span></p>
<br>
<p dir="LTR"><span lang="en-us"><font face="Consolas">Regards,</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">Micha</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> Thank
you so very much for your time Micha.</font></span></p>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">> Luciano</font></span></p>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">>
*De:*Micha Silver [</font></span><span lang="es-ar"></span><a
moz-do-not-send="true"
href="mailto:micha@arava.co.il%20%3Cmailto:micha@arava.co.il%3E"><span
lang="es-ar"><font face="Consolas">mailto:micha@arava.co.il
<mailto:micha@arava.co.il></font></span><span
lang="es-ar"></span></a><span lang="es-ar"><font
face="Consolas">]</font></span></p>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">>
*Enviado el:* Monday, November 05, 2012 4:01 AM</font></span></p>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">> *Para:*
Luciano La Sala</font></span></p>
<p dir="LTR"><span lang="es-ar"></span><span lang="en-us"><font
face="Consolas">> *Asunto:* [Bulk] Re: Two simple
questions</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> On
05/11/2012 04:42, Luciano La Sala wrote:</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
Hello Micha,</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
Where do you access the</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
modules///v.surf.idw/and///r.surf.idw/from?I just can’t seem
to</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
find them!</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> If you
run GRASS on its own (not the QGIS plugin), these modules
are </font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> under
the "Raster->Interpolate Surfaces"menu. In addition, all
GRASS </font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
commands can be run straight from the command line.</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
Thanks!</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
Luciano</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
This mail was received via Mail-SeCure System.</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> -- </font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> Micha
Silver</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> GIS
Consulting</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">>
052-3665918</font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span><span
lang="es-ar"> </span><a moz-do-not-send="true"
href="http://www.surfaces.co.il"><span lang="es-ar"></span><span
lang="en-us"><font face="Consolas">http://www.surfaces.co.il</font></span><span
lang="es-ar"></span></a><span lang="es-ar"></span><span
lang="en-us"></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">></font></span></p>
<p dir="LTR"><span lang="en-us"><font face="Consolas">> This
mail was received via Mail-SeCure System.</font></span></p>
<br>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">-- </font></span></p>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">Micha Silver</font></span></p>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">GIS
Consulting</font></span></p>
<p dir="LTR"><span lang="es-ar"><font face="Consolas">052-3665918</font></span></p>
<p dir="LTR"><span lang="es-ar"></span><a moz-do-not-send="true"
href="http://www.surfaces.co.il"><span lang="es-ar"><font
face="Consolas">http://www.surfaces.co.il</font></span><span
lang="es-ar"></span></a><span lang="es-ar"></span></p>
<br>
<br>
This mail was received via Mail-SeCure System.<br>
</blockquote>
<br>
</body>
</html>