[GRASS-user] row() and col() problem

Hamish hamish_b at yahoo.com
Tue Jun 23 03:43:30 EDT 2009


Jarosław Jasiewicz wrote:
> I try to generate map where every cell will have unique value
> I do that with following mapcalc formula:
> 
> map=(row()*451)+col()
> 
> where 451 is the total number of columns + 1
> 
> I expected following solution;
> 
> 452,453,454,455,....
> 953,954,955,956,....
> .....
> 
> But I recived:
> 
> 452,452,453,454,454,....
> 452,452,453,454,454,....
> 953,954,955,956,....
> 953,954,955,956,....
> ....
> 
> Where is the error in formula (or it is rounding problem)?


did you change the g.region resolution after creating the map?

if you do  'g.region rast=map' before output is it ok?


Hamish



      



More information about the grass-user mailing list