gpshslax

generating random lines

Discussion created by gpshslax on May 14, 2012
I'm not really sure this is the correct location to post this, but I thought I would take a stab at it.

I'm looking for a way to generate random lines on a specific lengths.  I'm going to be selecting a subset of line segments from a layer and need to generate a shape file with the following attributes.  Limited to the extend of a second layer; should contain the same number of lines, with the same lengths as those found in the original shape file; end points should be random pursuant too the first two requirements.

My best guess here is that I need to generate random points within the extend of the bounding layer, assign a random direction, assign an endpoint at the specified distance (equal to the specified distance from the origin point), discard and repeat if the endpoint is outside the extend of the bounding layer.

I have no idea how to accomplish this.  Anyone have suggestions for workflow.

Outcomes