def points_along_line(line_lyr, pnt_layer, pnt_dist):
line_lyr (feature layer) - Single part line
pnt_layer (feature layer) - Path to point feature class
pnt_dist (integer) - Interval distance in map units to add points
search_cursor = arcpy.da.SearchCursor(line_lyr, 'SHAPE@')
insert_cursor = arcpy.da.InsertCursor(pnt_layer, 'SHAPE@')
for row in search_cursor:
for dist in range(0, int(row.length), pnt_dist):
point = row.positionAlongLine(dist).firstPoint
if not arcpy.Exists(pnt_layer):
os.path.dirname(pnt_layer), os.path.basename(pnt_layer), 'POINT')
points_along_line(line_features, point_features, pnt_dist)
arcpy.SplitLineAtPoint_management(line_features, point_features, out_feature_class)
Coincidentally, this exact same topic came up in ArcPy Café the other week: Split into equal length features. A team member Dave (I don't know him other than his name is Dave) provided a fairly compact and elegant solution.
All I am trying to do is highlight a line segment and have to user click somewhere on the line and split it into two segments....user define split.
Just realized that and just did that…thanks
GIS Coordinator - Virginia Department of Game & Inland Fisheries
(new address) 7870 Villa Park Drive Suite 400, Henrico VA 23228
Phone: 804.367.6796 | Fax: 804.367.2628
ü Please consider the environment before printing this email.
Retrieving data ...