Select to view content in your preferred language

Split a Polyline with Variable Distance

2017
7
04-22-2018 03:01 AM
SoelemAafnan
Occasional Contributor

Hi,

I am trying to split a polyline into several sections. The sections are not same in the size. The "Split" option in the "Editor" toolbox only allows me to split the line into two sections. "Split Line at Points" tool lets me split the line into several sections, but I have to have a separate point file with points in my desired sections, which I don't have. I also don't know how to create a point file with points which are not equidistant to each other along a polyline. Is there any way I can split a polyline by my desired variable distance? I would appreciate the help.

Thanks in advance.

Tags (1)
0 Kudos
7 Replies
DanPatterson_Retired
MVP Emeritus

The arcpy.Polyline class has

positionAlongLine (value, {use_percentage})

Returns a point on a line at a specified distance from the beginning of the line.

segmentAlongLine (start_measure, end_measure, {use_percentage})

start_measure

The starting distance from the beginning of the line.

Double
end_measure

The ending distance from the beginning of the line.

Double
use_percentage

The start and end measures may be specified as fixed units or as a ratio.

If True, start_measure and end_measure are used as a percentage; if False, start_measure and end_measure are used as a distance. For percentages, the measures should be expressed as a double from 0.0 (0 percent) to 1.0 (100 percent).

(The default value is False)

you don't need to use percentages

XanderBakker
Esri Esteemed Contributor

As Dan mentioned using some Python would probably be the best way to solve this problem. See this thread for an example of using segmentAlongLine  https://community.esri.com/message/761470-re-splitting-polylines?commentID=761470#comment-761470 

How are you variable distances defined? Where are they stored (as attributes of each line feature, or in a related table)?

SoelemAafnan
Occasional Contributor

Thank you for the reply. My distances are stored as chainages of certain points in a spreadsheet. But surprisingly, I can't find the segmentAlongLine tool in arcpy, although I could find the positionAlongLine tool. What am I doing wrong? Another thing, how do I apply the tool to my desired polyline? The documentation for the segmentAlongLine doesn't show any place for the polyline that I need to split.

0 Kudos
DanPatterson_Retired
MVP Emeritus

I got the two links on the same page... scroll further... albeit it is the 10.6 help files, so if you are using an older version, it may not be in your help if you searched on your own and didn't follow my link

JayantaPoddar
MVP Esteemed Contributor

Did you try Linear Referencing?

Check the exercises of Linear Referencing Tutorial.



Think Location
XanderBakker
Esri Esteemed Contributor

What version of ArcGIS are you using? segmentAlongLine has been around for several versions. If you have a version without this method it is still possible to create a method to extract segments of a polyline. See this thread where I posted a snippet as example: https://community.esri.com/message/648311-re-trim-line-to-specified-length?commentID=648311#comment-... 

Also have a look at the suggestion made by Jayanta Poddar which could offer a solution for your use case. Specifically have a look at: About transforming event measures—Help | ArcGIS Desktop 

SoelemAafnan
Occasional Contributor

I am using ArcGIS 10.2.2. Thank you for the responses, I am looking into the options.

0 Kudos