[GRASSLIST:594] Re: creating reclass from dig_cats file

Moritz Lennert mlennert at club.worldonline.be
Wed Jul 2 05:20:34 EDT 2003


Michel Wurtz said:
> I don't have an access to the CVS tree due to a new provider, but I think
> the following text must be put on the m.in.e00 manpage... (Markus, do you
> hear me ? ;-)
>
> It is often desirable to use one of the original object attributes as
> value
> in the dig_att file (ex: elevation for contour lines, so you can made a
> dem,
> etc.)
>
> As a reminder : If ther is only one attribute (other than the standard
> ESRI
> attributes for lines or areas), ther is only one dig_cats file created,
> and
> its name is like the dig file name.  If there is many attributes, there is
> as many dig_cats files, named <vector_file_name>.<attribute_name>.  In
> this case
> the first thing to do is to go in the dig_cats directory and set a
> symbolic
> link to the dig_cats file you want as the new dig_att values.
>
> After that, you need only a two line command to change the att values.
> The
> best is to take an example :
>
> dig file name is brucom,
> dig_att/brucom looks like :
>
> # 48 categories
> brucom
>
> 0.00 0.00 0.00 0.00
> 1:67482
> 2:67492
> 3:67354
> 4:67240
> etc.
>
> What you have to type :
>
> export LOCATION=<your mpaset location>
> sed -e '1,4d' -e 's/:/ = /' $LOCATION/dig_cats/brucom | v.reclass

A question: if I interpret this script correctly, it will only work, if
the attribute label in the dig_cats file created by m.in.e00 is an
integer. However, if it is a text label, this will not work.
The awk script proposed in
http://op.gfz-potsdam.de/GRASS-List/Archive/msg08631.html seems to solve
this problem.
So maybe we should propose that instead, or in addition ?

Moritz




More information about the grass-user mailing list