GRASS and river classification

Can anyone provide any information on this problem.

Our organisation carrys out an annual classification of the English &
Welsh rivers. This ranges from 1A (excellent) to 4 (poor). We can produce
maps that show the various stretchs of the rivers coloured according to
classification on our old mainframe system - it uses a series of
classification points which have a certain class and apply upstream along
the river until another class point is found.

I'd like to use GRASS to create these maps - the question is how ??

We have the rivers as a vector dataset and I've loaded and plotted these.
How can I get different parts plotted in a colour corresponding to the
value of a point or do I have to somehow create a vector set for each
year of classification - but this would involve storing the coordinates
many times.

Thanks in advance for any help,

Steve Culshaw
NRA North West
e-mail : nra@cix.compulink.co.uk (use this for general usage)
or sculshaw@cix.compulink.co.uk (Private - only checked at best
biweekly)

[please follow-up to grassp-list]

N R A (nra@cix.compulink.co.uk) writes on 15 Jun 94:

Our organisation carrys out an annual classification of the English &
Welsh rivers. This ranges from 1A (excellent) to 4 (poor). We can produce

I'd like to use GRASS to create these maps - the question is how ??

We have the rivers as a vector dataset and I've loaded and plotted these.
How can I get different parts plotted in a colour corresponding to the
value of a point or do I have to somehow create a vector set for each
year of classification - but this would involve storing the coordinates
many times.

All you need are dig_att files for each year (assuming the rivers
have not been redigitized to reflect changes).

for the best approach, there are two tasks here:
  1. labeling lines
  2. plotting different colored lines according to labels

I won't comment too much on the first except to say (the obvious) that
each arc that you want colored different needs to be separate. That
is, you need to be able to label various stretches of the river
differently, depending upon your classification scheme. If the break
points or class boundaries cannot be predicted, then you have two options:
  1. make each (tiny) line segment an arc (which, as you have pointed out,
     would require mega-storage)
  2. use a base map and insert nodes at class boundaries each time
     a classification is done. (minimum storage)
One way to label these arcs is to use v.digit with the GRASS
monitor--I did this with streams in spearfish for the illustration
below. Depending upon your data, there are surely faster and easier
ways of doing this (using method 2, a short little program could
be developed to insert nodes given a list of eastings/northings).

Regarding the second task, plotting, I'll give the quick and dirty
solution then propose something more sweeping.

| % d.vect.cat help
|
| Usage:
| d.vect.cat map=name [color=name] cat=value[,value,...]
|
| Parameters:
| map Name of existing vector map to be displayed
| color Color desired for drawing map
| options: white,red,orange,yellow,green,blue,indigo,violet,magenta,
| brown,gray,black
| default: white
| cat Vector category type to be displayed

(I think that I must have written this at one time since I have the
binary in ~/bin, but I guess that I threw the source code away... it
should also have an option type=point|line|area but I guess I never
got around to that either.)

Cheerio!

--Darrell

James Darrell McCauley, Purdue Univ, West Lafayette, IN 47907-1146, USA
mccauley@ecn.purdue.edu, mccauley%ecn@purccvm.bitnet, pur-ee!mccauley

-----------------------diffs for d.vect.nra------------------
% pwd
/home/soils/h/mccauley/d.vect
% diff cmd org
diff cmd/Gmakefile org/Gmakefile
1c1
< PGM = d.vect.nra
---

PGM = d.vect

19c19
< $(PGM): $(OBJS) $(LIBES)
---

$(BIN_MAIN_CMD)/$(PGM): $(OBJS) $(LIBES)

diff cmd/main.c org/main.c
34a35,41

      opt2 = G_define_option() ;
      opt2->key = "color" ;
      opt2->type = TYPE_STRING ;
      opt2->answer = "white" ;
      opt2->options = D_color_list();
      opt2->description= "Color desired for drawing map" ;

48a56,57

      color = D_translate_color(opt2->answer);

60a70,71

      R_standard_color(color) ;

diff cmd/plot2.c org/plot2.c
19d18
< int linecolor;
21c20
< int line=1, nlines;
---

    int line, nlines;

93,99d91
<
< linecolor=V2_line_att(&P_map, line++);
< if (linecolor<=4 && linecolor>0)
< R_standard_color(linecolor);
< else
< R_standard_color(WHITE);
<

[followups (from now on :slight_smile: to grassp]

James Darrell McCauley (mccauley@ecn.purdue.edu) writes on 17 Jun 94:

Regarding the second task, plotting, I'll give the quick and dirty
solution then propose something more sweeping.

oops - getting use to new key-bindings - I seem to have deleted both
before the message was sent. To summarize:

The former was to label each line (not area) & create d.vect.nra:

         linecolor=V2_line_att(&P_map, line++);
         if (linecolor<=4 && linecolor>0)
           R_standard_color(linecolor);
         else
           R_standard_color(WHITE);

The latter was for someone to implement:

  $LOCATION/
    dig_color/
      mapname/
        lines
        points
        areas

with changes to d.vect.

d.vect.cat was an alternative to creating color tables.

--Darrell