Title: Still in trouble
Hi Luciano:

Keeping the discussion on  the grass-users list

On 11/7/2012 10:57 PM, Luciano La Sala wrote:


 

I tried both options (your message below); i.e. reverting back to vectors and multiplying my risk raster by a constant (in this case 1000) to get integer

values 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...



(clipped)

Then run r.surf.idw on that and I get Screen_03, the weirdest map ever!


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.

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:

1- take a vector polygon of the whole country, and import it into GRASS.

2- Then use "v.to.rast argentina_poly type=area use=val value=1 out=argentina_rast" to convert it to a raster.

3- Next set this argentina raster as the MASK with "r.mask argentina_rast"

4- and now rerun the interpolation


Finally, I divide the result by 1000.0 again (not 1000, like you said, to insure that the result is a floating point) to get back to my normalized values, but the same weird raster map remains (Screen_04).


Check the values you got with r.info.


Where is it that I am going so wrong? To do all this I didnt use QGIS, so I am not referring the message to the list.   

Very best,

Luciano

<<...>> <<...>> <<...>> <<...>>

-----Mensaje original-----
De: Micha Silver [
mailto:mi...@arava.co.il]
Enviado el: Tuesday, November 06, 2012 6:20 AM
Para: Luciano La Sala
CC: grass-user
Asunto: [Bulk] Re: [Bulk] Re: Two simple questions

Hi Luciano:

(Returning to the maillist - maybe this will help others...)

On 05/11/2012 18:29, Luciano La Sala wrote:

> Two simple questions

>

> Thank you Micha, I found the icons right under my nose.

>

> To tell you the truth I am kind of lost here. I am trying to do the

> interpolation from within QGIS using the raster map of risk I did

> following your instructions (JPEG attached).

>

> Pixel values, as calculated using the “r.mapcalculator” module in

> GRASS, are (from the lightest yellow to the darkest red):

>

> 0.0406

>

> 0.1422

>

> 0.4268

>

> 0.5284

>

> 0.7154

>

> 0.8983

>

> I first used the module “r.surf.idw” module (Screen_01) which runs

> successfully but produces an entirely black raster map as output

> (Screen_02). All the pixels of this raster contain a value of 1.

>

> There is obviously something wrong here. Any tips? Should I use

> “v.surf.idw” instead?

>

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:

* revert back to vectors, as you suggest. (v.surf.idw accepts decimal

values)

     r.to.vect -z in=risk_raster out=risk_vector feature=point

     v.surf.idw in=risk_vector out=risk_idw layer=0


OR


* multiply your risk raster by some constant, say 1000, to get integer

values. Then run r.surf.idw on that, and divide the result by the same

1000 again to get back to your normalized values.

     r.mapcalc risk_integer=risk_raster*1000

     r.surf.idw in=risk_integer out=risk_idw_tmp

     r.mapcalc risk_idw=risk_idw_tmp/1000.0

     # Use the decimal value 1000.0 to insure that the result is

floating point.


Regards,

Micha

> Thank you so very much for your time Micha.

>

> Luciano

>

> *De:*Micha Silver [mailto:mi...@arava.co.il <mailto:mi...@arava.co.il>]

> *Enviado el:* Monday, November 05, 2012 4:01 AM

> *Para:* Luciano La Sala

> *Asunto:* [Bulk] Re: Two simple questions

>

> On 05/11/2012 04:42, Luciano La Sala wrote:

>

>     Hello Micha,

>

>     Where do you access the

>     modules///v.surf.idw/and///r.surf.idw/from?I just can’t seem to

>     find them!

>

> If you run GRASS on its own (not the QGIS plugin), these modules are

> under the "Raster->Interpolate Surfaces"menu. In addition, all GRASS

> commands can be run straight from the command line.

>

>     Thanks!

>

>     Luciano

>

>

>

>     This mail was received via Mail-SeCure System.

>

>

>

>

> --

> Micha Silver

> GIS Consulting

> 052-3665918

> http://www.surfaces.co.il

>

>

> This mail was received via Mail-SeCure System.


--

Micha Silver

GIS Consulting

052-3665918

http://www.surfaces.co.il



This mail was received via Mail-SeCure System.

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

Reply via email to