[GRASS-user] generate a grid with sequential numbers

Moritz Lennert mlennert at club.worldonline.be
Mon Sep 17 08:46:38 PDT 2012


On 17/09/12 16:05, Janet Choate wrote:
> Hi all,
> does anyone know how to generate a grid where the numbers are sequential?
> i have used r.random.cells to create a grid, but grids are numbered,
> well, randomly.

Maybe r.mapcalc with a combination of the row() and col() functions ? 
Depending on the number of cells you have you can do something like 
this: row()*10000+col(). This will give you an ordered sequence, but 
numbers from one line to the next will have a gap. If you need perfectly 
sequenced numbers, I imagine it's possibly to find a formula that gives 
you that...

Moritz


More information about the grass-user mailing list