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

Moritz Lennert mlennert at club.worldonline.be
Sat Jul 5 17:30:20 EDT 2003


Michel Wurtz said:
> Moritz Lennert wrote:
>> 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.
>
> Yes, but this is a "feature" of grass vector files...
>
>> The awk script proposed in
>> http://op.gfz-potsdam.de/GRASS-List/Archive/msg08631.html seems to solve
>> this problem.
>
> Hmm... I don't really understand what this script add.  I believe that
> using a symbolic link on the text label file for the dig_cats file gives
> the same result as the script... (except that it will not create another
> vector file).
>

Imagine you have a file with 1000 polygons representing soils. Each
polygon belongs to one of 40 soil categories. However, these categories
are identified with text codes. m.in.e00 will give you a dig_att file with
1000 lines and 1000 category numbers and a dig_cats file with 1000 lines
linking each of the 1000 categories to one of the 40 soil types. However,
if you want to create a map with 40 different colors representing these 40
different soil types, you will need to each of the polygons attributed to
one of 40 categories, not to one of 1000. Since you can't just use the
text attributes to do that, you have to transform the 40 soil types into
40 unique category numbers and link avery polygon to one of these numbers
in a dig_att file. The corresponding dig_cats file will then link those 40
numbers to the 40 textual soil types.

If I understand correctly, this is what the awk script does, whereas the
sed script doesn't.


> The solution imho is to switch to grass5.1, where attributes are far
> better handled.

True, but people might not feel comfortable to do so, yet, especially
since some features are still lacking.

Moritz




More information about the grass-user mailing list