[GRASS-user] Re: r.mapcalc r.mapcalculator question

varunvarma varunvarma17 at gmail.com
Wed Jun 16 04:10:49 EDT 2010



Micha Silver wrote:
> 
> On 15/06/2010 16:45, Dr. Manfred Redslob wrote:
>> Am Dienstag, den 15.06.2010, 06:39 -0700 schrieb varunvarma:
>>    
>>> Hi, I am a new user to GRASS and have run into a problem while
>>> processing
>>> rasters
>>>
>>> I have 2 raster files (TIFFs) which I have loaded with GRASS in QGIS
>>> 1.0.2
>>> Kore. The rasters contain values of 0 and 1 and represent 2 time steps.
>>> What
>>> I wanted to do is either a simple addition of the 2 rasters or apply an
>>> OR
>>> operator between them. For this I used the r.mapcalc and r.mapcalculator
>>> tool. However, the cell size of the resulting raster is increased from
>>> 250m
>>> to 2500m which leads to loss of fine scale information.
>>>
>>> Does anyone know why this is happening and what I could do to maintain
>>> the
>>> fine scale information?
>>>
>>> Thank you
>>>      
>> Hi however,
>>
>> please check the actual resolution with g.region -p. Is the result
>> res=2500? If so, set region with g.region -ap res=250 or with g.region
>> rast=inputrasterfile. You can controll it again with  g.region -p. After
>> this settings run r.mapcalc again.
>>
>> Regards,
>>
>> Manfred
>>
>>    
> In addition, to do the same thing within QGIS, you can use the "Edit 
> current region" button on the GRASS toolbar. Just enter the value you 
> need in the N-S resolution and E-W text boxes.
> 
> Another note: I might suggest you upgrade to a newer version of QGIS.  
> Version 1.4 (and soon to be released 1.5) have many improvements and bug 
> fixes.
> Regards
> 
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>> This mail was received via Mail-SeCure System.
>>
>>
>>    
> 
> 
> -- 
> Micha Silver
> http://www.surfaces.co.il/
> Arava Development Co.  +972-52-3665918
> 
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
> 
> 

Thank you all for your replies. I ran g.region to set the cell size (res) in
GRASS 6.4.0 and then used r.mapcalc to do an addition between the rasters
and it worked perfectly.

Just to understand the solution better, is there a reason why the cell size
was changed when an addition was performed on the rasters OR was it that the
cell size was changed when rasters were imported into GRASS?

Thank you,
Varun
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-mapcalc-r-mapcalculator-question-tp5181949p5185436.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list