[GRASS-dev] [bug #2793] (grass) v.segment: side offset is ignored

Hamish hamish_nospam at yahoo.com
Thu May 3 05:53:27 EDT 2007

Markus Neteler via RT wrote:
> https://intevation.de/rt/webrt?serial_num=2793
> Apparently Vect_point_on_line() lacks support for side offset. Indeed,
> it doesn't even have such a parameter.
> We can now either remove all the side_offset stuff from the manual
> page or convince a developer to expand Vect_point_on_line(). The
> functions used in v.buffer/v.parallel might be helpful in this regard.

Vect_point_on_line() is fine, the adjustment should come just after:

ret = Vect_point_on_line ( LPoints, offset1, &x, &y, &z, &angle, NULL);

/* Should Vect_point_on_line be passed the side offset here? */
/***  (YES) ***/

if(side_offset != 0.0)    better? if(fabs(side_offset) > 0.0)
  shift_point_90(&x, &y, side_offset, angle);
Vect_append_point ( SPoints, x, y, z );

if we know the slope of the line at the point (angle*), it is easy
enough to calculate a point perpendicular to it (in the x,y plane)
offset by a certain distance with a little trig.

  *angle     - pointer to angle of line in that point (radians, 
               counter clockwise from x axis) or NULL

with luck the line direction is ok- shift off to the left or right?

can anyone compose a nicer example for the v.segment help page?
(v.to.points -n or -v to get points?)

or is <side offset> for a threshold? (I'm not really sure how v.segment
is supposed to work)

For 6.2 we should <!-- comment out --> the references to it in the help


More information about the grass-dev mailing list