bulk label lines

Darrell McCauley mccauley at ecn.purdue.edu
Tue Oct 19 21:46:09 EDT 1993


Darrell McCauley (mccauley at ecn.purdue.edu) writes (to grassu) on 19 Oct 93:
>Virginia Jackson (jackson at 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



More information about the grass-dev mailing list