[GRASS-user] Automate way for filling category labels

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?

Regards,
Christian.

----------------------------------------------------------------
This mail was sent through http://webmail.uni-jena.de

On Fri, Aug 22, 2008 at 11:12 AM, Christian Schwartze
<Christian.Schwartze@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

Thanks, now I know that r.category is only part of grass >= 6.3 :wink:

Christian.

Am Freitag, den 22.08.2008, 16:15 +0200 schrieb Markus Neteler:

On Fri, Aug 22, 2008 at 11:12 AM, Christian Schwartze
<Christian.Schwartze@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