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

Hamish hamish_nospam at yahoo.com
Thu May 3 08:08:02 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.
> Hamish:
> > 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.

now functional in CVS. please test.

Backport to 6.2 or comment out references to offset in the help page?

> > shift offset to the left or right?

I have set it to shift to the left as you go along the line, for little
reason other than I had to pick something and that's the side of the
road we drive on here. If there is a reason to have positive offsets
shift to the right (e.g. v.lrs or vector topology side 1,2 conventions;
Cartesian axes make +x go to the right; electro-magnetic interactions;
other..) let me know and I'll swap it.

Untested on 3D points & lines. Right now it outputs in the xy plane, but
full 3D points would be possible using Vect_point_on_line(...,slope);
(probably reuse Lat/lon code for that!) but offset is only 1D right now.
Vect_line_parallel() is only 2D AFAICT, so lines would require more
work, but would be a cool feature to have. (but again with the 1D offset)

still open:
> can anyone compose a nice example (x2) for the v.segment help page?


More information about the grass-dev mailing list