I have a polyline layer that has been joined to a table and I need to split it at certain distances along the line.
The attribute table contains the distances at which I would like to split the lines. The attribute table looks like this:
I need to split the line a two spots, ChStaL and ChStaR, which are both distances from the starting node.
I'd really like a python type solution if possible as I have over 30 of these layers.
I've been cruising around ESRI help docs and ArcToolbox but, haven't found anything that will allow me to do this en-mass. Almost everything out there requires me to do manually editing.
Any help would be most appreciated.
Answer
In 10.1 you could use the new positionAlongLine
function to generate the points you want to split by, and then use the Split Line at Point tool.
I don't have 10.1 installed to test with but you would basically do the following:
- Create a new empty point feature class
- Open a
SearchCursor
on your line feature class - Open an
InsertCursor
on your point feature class - For each line:
- Get a point using
positionAlongLine
with your first distance attribute (ChStaL
) - Get a point using
positionAlongLine
with your second distance attribute (ChStaR)
- Insert the two points into the point feature class
- Get a point using
- Delete the cursor objects
- Use Split Line At Point to create a new line feature class with lines in the original line feature class split by the points in the now-populated point feature class.
Alternatively use linear referencing as mentioned in @Horbydd's answer.
No comments:
Post a Comment