Feature Line Split

Document created by Holisticbynature on Sep 20, 2015Last modified by Holisticbynature on Feb 3, 2018
Version 18Show Document
  • View in full screen mode

Hi All,

 

I got inspired by an Arcpy Cafe post to develop a tiny scripting tool that takes an existing polyline feature layer and proportionally splits into  a desired number of segments of equal length. This scripting tool will enable you to do batch editing based on either an input field or just split all the lines into segments of equal length. This tool WILL attempt to copy the fields from the original feature class.

I have since changed these tools so that they include more editing tools for lines:
New tools include tools to:

Pull back line any target amount. For example, if you have an analysis of point features near intersections of a planar network (collision analysis/asset information), you can do spatial joins to these modified lines knowing that their approaches are excluded (without having to derive intersection points/nodes). There are other applications of this type of editing tool. 

Github Repo for the tool is here: GitHub - Holisticnature/feature-line-split: The goal of this toolbox is provide a set of batch line editing tools for Ar… 

Download Link

Zip File attached, Summary and Usage belows.

Summary

I have updated this toolbox to include some new line editing tools that might be useful. See summary by tool below. 

Feature Line Split

This scripting tool will take an input feature line, and split its line features into the number of target segments or target distance specified by the target specified by the input integer or input field. Each line feature will be split into the number of segments specified. This version of the script will carry over any of the fields of the original feature class using cursors, it will only split the geometry into equal length segments for a number of segments for each line equal to the target count. Works in ArcGIS PRO and ArcGIS 10.3+

Usage

The goal of this script was to split target line features into (such as routes or paths) for all the line features in a feature layer, into segments of a target length or split equally into a target segment count similar to many of the proportional editing tools. The intended uses for this are:

  • Aid in the creation of study segments to summarize data on for networks.
  • Aid in the creation of animations for routes by allowing the creation equal length converging line segments whose ends can be converted to points.
  • Provide a tool for batch editing and segmentation of polylines. Works in ArcGIS Pro (2to3 compatible).

Parameters

ParameterExplanationData Type
Input_Feature_LineDialog Reference

This is the input feature class whose individual geometry features will be broken into the number of desired target segments and put into a new feature class. The input can only be a polyline for this tool, because it uses Polyline specific methods.

___________________

Python Reference

This tool depends on the segmentAlongLine method in ArcGIS 10.3.

Feature Layer
Segmentation_NumberDialog Reference

This is either the target number of segments for the output lines or the target length in the units of the current projection of the segments for the output lines depending on the split method.

There is no python reference for this parameter.

Long
Segmentation_Field (Optional)Dialog Reference

This is a field that denotes the target number of segments for the output lines or the target length in the units of the current projection of the segments for the output lines depending on the split method. If a field is chosen it will override the segmentation number parameter.

 

There is no python reference for this parameter.

Field
Split_MethodDialog Reference

This parameter denotes how the input lines will be split. Length will use the current projection's linear units and the chosen segmentation field or value to split the input lines into segments of the chosen length (or close to the chosen length if Best Fit is True). Segment Count will break the lines into segments of equal length based on the segment count.

There is no python reference for this parameter.

String
Best_Fit_LineDialog Reference

If True and Length is the split method, the lines will be split into segments of length closest to the target determined by the value or field while not creating short end segments. It will result in lines closest to the target length but maintain lines of equal length in the output.

There is no python reference for this parameter.

Boolean
Output_Feature_LineDialog Reference

This is the output polyline feature class that will be created by this tool. It should have the fields of the original feature class derived by an insert cursor.

___________________

Python Reference

Uses insert cursors to get the desired "copy" of the segmented feature class.

Feature Class

Feature Line Pull

This scripting tool will take an input feature line, and remove a target amount of length from the ends of the lines (pulling them back). Each line feature will be copied once. This version of the script will carry over any of the fields of the original feature class using cursors, it will only return pulled back geometries in the new feature class. This is different from trim line or similar tools- this will pull all lines back the target amount. 

Usage

The goal of this script was to split target line features into (such as routes or paths) for all the line features in a feature layer, into segments that are pulled back a target amount. The intended uses for this are: Aid in the creation of study segments to summarize data on for networks. Allow proximity analysis for point features that do not include intersections. Provide a tool for batch editing and segmentation of polylines. Works in ArcGIS Pro (2to3 compatible)

Parameters

ParameterExplanationData Type
Input_Feature_LineDialog Reference

This is the input feature class whose individual geometry features will be pulled back and put into a new feature class. The input can only be a polyline for this tool, because it uses Polyline specific methods.

___________________

Python Reference

This tool depends on the segmentAlongLine method in ArcGIS 10.3.

Feature Layer
Pull_AmountDialog Reference

The distance in units of the current projection, that you wish your line features to be pulled back.

There is no python reference for this parameter.

Long
Pull_Field (Optional)Dialog Reference

A Field using a distance in units of the current projection, that specifies the amount you wish your line features to be pulled back.

 

There is no python reference for this parameter.

Field
Start_Point_PullDialog Reference

Determines whether the line has a distance starting at the line start point is pulled back.

There is no python reference for this parameter.

String
End_Point_PullDialog Reference

Determines whether the line has a distance ending at the line end point is pulled back.

There is no python reference for this parameter.

Boolean
Output_Feature_LineDialog Reference

This is the output polyline feature class that will be created by this tool. It should have the fields of the original feature class derived by an insert cursor.

___________________

Python Reference

Uses insert cursors to get the desired "copy" of the segmented feature class.

Feature Class
5 people found this helpful

Attachments

    Outcomes