bulk label lines

Darrell McCauley (mccauley@ecn.purdue.edu) writes (to grassu) on 19 Oct 93:

Virginia Jackson (jackson@era.com) writes on 19 Oct 93:

Does GRASS 4.1 have a non-interactive "bulk label lines" command?
I like the v.alabel command and I was hoping that v.llabel (or whatever)
already existed.

I modified v.alabel to do this just now (only took a few minutes).
It may need some testing, but it has worked on the test cases that
I threw at it.

what I did here was:

        if ( 0 < Vect_read_next_line(&Map,Points) )
        {
          X = Points->x[1] + 0.5*(Points->x[0] - Points->x[1]);
          Y = Points->y[1] + 0.5*(Points->y[0] - Points->y[1]);
        }
  else
  {...

where X and Y are the location of the label points. Is this
valid? It worked on my UTM test case (just digitized some lines
using v.digit/XDRIVER and then ran v.llabel). Are there instances
where this will fail?

[I originally had
          X = Points->x[0] + 0.5*(Points->x[0] - Points->x[1]);
          Y = Points->y[0] + 0.5*(Points->y[0] - Points->y[1]);
but this put the label point east of the lines.]

Instead of contributing this to 4.2, I may try to merge the changes
into one program for areas, lines, and sites and require the user to
specify a -l flag (or a -s flag for sites). This would be much

If someone else wants to play with this, have at it.
I'm a little tied up with prelims at the moment. %-(

--Darrell