How to merge lines?

4165
5
10-04-2010 12:33 PM
KonstantinFilimonenkov
New Contributor
Hello,

I have a set of features (Polyline ZM) .
The end of one line is the beginning for another.
How would it be possible to combine all small polylines (separate features) into one big polyline (one feature)?
What options exist?

Thank you for help,
Konstantin
0 Kudos
5 Replies
DonovanCameron
Occasional Contributor II
If the two lines have matching attributes and a unique ID that they both share (ie, road name, type, surface condition, etc) then you can run the Dissolve tool on the field that they both share.

Dissolve Tool
0 Kudos
KonstantinFilimonenkov
New Contributor
Thank you SaultDon,

Unfortunetely, there are no shared attributes.
However, one attribute is the name of the feature. Names look like "Line1 A", "Line1 B", "Line1 C",...,"Line2 A", "Line2 B", "Line2 C",...
So, the idea is to combine all small lines (features) "Line1 %" into a single line (feature) "Line1". Similar to all other lines - one "Line2", one "Line3", etc
I assume standard ArcGIS extensions will not help me with my task.
I'm ok with doing it through coding in Python or .NET, but I don't know from where to start. I never parsed shape files and never wrote add-ins for ArcGIS.
Any advice is appreciated.
I would realy like to dive in all these things, but first of all to solve my specific problem.

Kons
0 Kudos
DonovanCameron
Occasional Contributor II
Thank you SaultDon,
Unfortunetely, there are no shared attributes.
However, one attribute is the name of the feature. Names look like "Line1 A", "Line1 B", "Line1 C",...,"Line2 A", "Line2 B", "Line2 C",...
So, the idea is to combine all small lines (features) "Line1 %" into a single line (feature) "Line1". Similar to all other lines - one "Line2", one "Line3", etc


You could format those fields to set the data up for a dissolve.

Create a new text field in each of the feature classes attribute table and use the field calculator to populate the records using specific characters from the existing fields that show the line names ie, "Line1 A" would become "Line1" and "Line 2 A" would become "Line2" so they would result in having the same Unique ID now.

The expression to use in the field calculator would be something like this for all feature classes.

Left([LineName], 5)


# if you have a field that says something like Line12 A, then change the 5 to 6. This will then require you to run a second field calculator on the field using the Trim expression to eliminate the space where it was recorded from fields that said Line5 A would of become "Line 5 " with the space at the end requiring the trim.

Trim([NewLineName])


After you have set the attributes up for all feature classes requiring the dissolve, merge them together first, then run the dissolve.
0 Kudos
KonstantinFilimonenkov
New Contributor
Thank you SaultDon,

that helped a lot
There are still some problems with preparing names for a new attribute field (originally names are not so nice as "Line1 A", more messy), but I think I'll manage the rest.

I'm not sure if I should start a new thread...
The next challenge is to delete "unnecessary" points from which a new dissolved line consist.
I would like to leave only joint points (points where the line changes the direction). Now, the straight line could contain like 200 points, whereas it can be built by 2.
Is there a way to get rid of these "unnecessary" points.

Thank you in advance.
0 Kudos
HuwGreenhough
Occasional Contributor
I'm not sure if I should start a new thread...
The next challenge is to delete "unnecessary" points from which a new dissolved line consist.
I would like to leave only joint points (points where the line changes the direction). Now, the straight line could contain like 200 points, whereas it can be built by 2.
Is there a way to get rid of these "unnecessary" points.

Thank you in advance.

I hope you get a good answer to this. I would like the same tool, but existing ones all seem to simplify bends as well as straight lines. See:
http://forums.esri.com/Thread.asp?c=93&f=987&t=58829&mc=17#806676
A while after that post, someone eventually came up with a script, but I assume that won't work now that 10 has moved to Python.
0 Kudos