Extending line features based on other line features

398
1
01-28-2012 11:42 PM
HenWagner
New Contributor III
Hi
I have 2 line feature classes, All Roads and Roads Parts.
Road Parts was created from All Roads.
I want to extend Roads Parts based on the All Roads paths. Each feature should be extended by X meters from one side and by Y meters from the other side.
Meters count should be along the path (not radius- buffer isn't an option).

I looked at the Extend Line function but it doesn't seem to be it.

Any ideas?
Tnx
Tags (2)
0 Kudos
1 Reply
HenryColgate
Occasional Contributor
Essentially what you are trying to do is extend a straight line.  As all straight lines can be represented by a linear equation once you solve this you can extend it easily.  Luckily linear equations are super easy.

I'm not sure how good your linear algebra is but here is a link to a site with a nice simple tutorial on solving the slope given x and y.  It is a little bit down from the top of the page. 

http://www.purplemath.com/modules/strtlneq2.htm

Use X1, Y1 and X2, Y2 with each other to get either X1, Y2 or vice versa to make a triangle.  Then you can solve the straight line length with the triangle using Pythagorean theory.

Once you have the length I think it would be easy to use a loop to iterate through possible XY coordinates that will get you the right value length or the better solution may be to find and balance an equation that will give you the appropriate info but I can't think of what this is off the top of my head.

I reckon there is probably something in Numpy or some such mat module to do most of the work for you but it is probably just as easy to write from scratch.
0 Kudos