[GRASS-user] easy question.

Glynn Clements glynn at gclements.plus.com
Tue Jun 9 12:36:13 EDT 2009


achim wrote:

> I have a vector layer with category numbers with very very high numbers.
> Thats not very useful for further work. Now I want to change the cats to
> an ascending order (1,2,3,...,n).
> 
> Is that possible in an easy way? Or even if there is a complicated one
> it would be great.

r.reclass can create a reclass map. You can generate the reclass rules
using r.category and awk, e.g.:

r.category oldmap | awk '{print $1,"=",NR}' | r.reclass in=oldmap out=newmap

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list