[GRASS-user] Automate way for filling category labels

Markus Neteler neteler at osgeo.org
Fri Aug 22 10:15:08 EDT 2008


On Fri, Aug 22, 2008 at 11:12 AM, Christian Schwartze
<Christian.Schwartze at uni-jena.de> wrote:
> Hi GRASS users,
>
> I was wondering if I do somewhat right all the time... There is r.in.gdal what I
> use for the import of a geotiff. Basically the entries for the labels of the
> cats are empty after the import. So I do some pipelining combined with awk,
> like:
>
> r.stats -n input=img | awk '{print $1,\" = \",$1,$1;}' | r.reclass input=img
> output=img_new"
>
> So the labels are filled with the category, that works fine and I need the
> non-empty labels in further steps, e.g. in r.statistics.
> It seems to me a little bit tricky but I found no other solution..., what do you
> think?

Wouldn't r.category help here?

r.category diseasemap  rules=- << EOF
1:potential absence
2:potential presence
EOF

Markus


More information about the grass-user mailing list