Joining multiple polyine segments into one polyline

4899
3
12-14-2011 11:18 AM
StephenFricke
New Contributor III
I am trying to do a select by location of all snowmobile trails that intersect a major road. The problem I am having is the the snowmobile trails is made up of over 1,000 really short polylines, and even though a lot of them are connected in some sort of loop they are treated as separate polylines with separate FID's. Therefore when I do a selection for polylines that intersect with the major roads it is only a few short segments which are nearly right on top of the road, and all other segments of the trail that obviously connect to the road are not selected because they are technically classified as separate polylines which don't intersect the road. I've been looking around for ways to join all polylines that touch and make that into one long polyline, but I haven't had any luck. Any ideas how I would write a python script to perform a task like this would be greatly appreciated. Thanks!
Tags (2)
0 Kudos
3 Replies
MathewCoyle
Frequent Contributor
If they are spatially connected but separate features, Dissolve will solve this for you.
StephenFricke
New Contributor III
If they are spatially connected but separate features, Dissolve will solve this for you.


Hey thanks for the response.  An issue that I am having running the dissolve tool is that I am checking the unsplit lines option, which works well for aggregating many little polylines together, but when there comes a fork in the snowmobile trail, the polyline splits into three, the original trail, and the two paths the fork takes.  I want these all to be part of the same polyline because they are all touching and they all lead back to a major road.  I would think that the three trails should be dissolved together because the unsplit line option says that lines that share a common end vertex will be dissolved.  I can't uncheck the unsplit line option because then trails that are not even touching are dissolved into one polyline.  Any advice anyone has for this problem would be much appreciated!
0 Kudos
KimOllivier
Occasional Contributor III
You need to use Linear Referencing.

Use an attribute that groups the polylines into the same general track and build a route system. Braided routes are generally difficult to analyse subsequently for paths because they are ambiguous, but it might suit what you are  doing.

I have numbered the segments with an ID and also added a ROUTEID (10, 20) to use in CreateRoutes.
0 Kudos