[GRASSLIST:5420] RE: please help me generate an adjaceny list

John Gillette JGillette at rfmd.com
Fri Jan 31 09:44:13 EST 2003


Radim,
  What is the cat of Map.Line[1]?
  In other words,  I want 
  to also print the line category number.

  Would it be:
  linecat = Map.Att[Lines->att].cat
  (which I think is equvalent to
            Map.Att[Map.Line[i].att].cat
  

John

> ... Code may be like this:
> for (i=1; i <= Map.n_lines; i++) {
>     Line = &(Map.Line[i]);
>     if (Lines->type != AREA)   continue;
>     lcat = rcat = 0;
>     if (Lines->left != 0) 
>         lcat = Map.Att[Map.Area[Lines->left].att].cat;
>     if (Lines->right != 0)
>         rcat = Map.Att[Map.Area[Lines->right].att].cat;
>     fprintf (stdout, "%d %d", lcat, rcat);
> }
> 
> Radim
 




More information about the grass-user mailing list