Skip to content

how to generate perpendicular transects along a line feature

2 messages · Barry Rowlingson, LeRoy Elliott

#
On Tue, Jun 4, 2013 at 12:49 PM, LeRoy Elliott <lfelliott at hotmail.com> wrote:
Shouldn't be that hard....

 Is the stream a single line feature that can be just a series of x,y,
coordinates? You've not got a stream network? If its just a single
line feature of connected x,y coordinates then step 1 is fairly easy:

 step 1. start at one end, compute cumulative line segment lengths,
work out which segments seq(0,length(stream), by=50) fall into. Work
out how far along each line segment those distances occur, compute x,y

 step 2. use the end points of the line segment to compute the angle
(atan2(dx,dy))

 step 3. add pi to the angle, do a quick sine and cosine computation
to get the transect perpendicular

Is your line feature that simple?

Barry