Wednesday 30 September 2015

Assigning common field value to segments between two points using ArcGIS for Desktop?


I am using ArcGIS 10.3 for Desktop.


I have a shapefile with polylines connecting points. Instead of having one single polyline connecting two points, there exist a number of consecutive segments connected to each other (see image below).


These segments, however, have no field values in common, so if I wanted to use Dissolve to merge all of them together it would not work the way I expect.


Is there a way to assign a common field value to all the segments between two consecutive points? This way, Dissolve could be used effectively. I am open to any kind of solution, and would prefer a Python-based one, if available.


Visual example: all segments in between point A and point B should get a common field value, so that they can be later merged. This should apply to all segments in between any two points.


enter image description here


This question is not a duplicate of ArcGIS 10.3: How to merge lines divided by junction points?, which I myself have asked. Rather, this question is a precursor to it, if you like.


Screenshot of the real situation. Red dots are the equivalent of Points A and B, while the segments are recognizable by the junction points in green (there is a segment in between each pair of consecutive green dots). For each red dot, I want one single incoming and one single outgoing line.


enter image description here




Answer



You could just give all lines a common attribute value, use dissolve to merge them, then use split-lines-at-points to recreate the segments between the red points.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...