1

enter image description here

I am using ArcMap.

I have polylines of 80+ bus routes operating in a city. The polylines have attribute values for the number of passengers, number of trips, etc. Many of the polylines overlap at certain areas of the road network. What I want to do is to save the overlapping portions into separate individual shapefiles, that have attribute values that correspond to the sums of those original values.

I know how to do this the long way (find the overlaps, cut them and save the separate shapes, manually calculate the attribute values, enter and save the data) but is there a way to do it easier/faster without using scripts?

For example in the image above, the Green Route has 1,000 passengers and travels 20 trips a day while the Orange Route has 500 passengers and 10 trips a day. I'd like to cut out the overlapping area and save it as a separate shapefile with data on 1,500 passengers and 30 trips. This is just a simple example with two routes but I have 80+ in all that overlap in many locations with each other.

0
3

I solved this problem with clues from @FelixIP's answer, and great help from the answer I found at How to sum line features.

Step 1:

Make sure all overlapping lines are actually overlapping. Using Integrate tool helps.

Step 2:

Use Merge to combine all the individual polylines into one shapefile.

Step 3:

Create a polygon that is large enough to cover the entire polyline.

Step 4:

Use Intersect tool between polygon and polyline with LINE as output type. This will create multiple copies of overlapping line segments and single copies of each non-overlapping line segments. Some of the non-overlapping line segments will be multipart features. This will not be a problem and can be separated into single parts in Step 6.

Step 5:

Use Add Geometry Attributes tool. CENTROID did not work for me but CENTROID_INSIDE did.

  • CAUTION: This will overwrite the shapefile so make sure to backup before running.

Step 6:

Use Dissolve tool. Select INSIDE_X and INSIDE_Y as Dissolve Fields. Select data to combine (no. of passengers, no. of trips) as Statistic Fields and SUM as Statistics Type. Uncheck "Multi_part".

1
  • Just going to add here for my own use. Step 3; when creating the polygon it much engulf all polylines. To do this, use the buffer tool, and in the 'Dissolve Type' use the 'dissolve all output...' option. Continue to follow the next steps.
    – Ethan
    Nov 4 at 23:42
2

INPUT:

enter image description here

WORKFLOW:

arcpy.Dissolve_management("ROUTES", "..SCRATCH.gdb/SEGMENTS", "SINGLE_PART")
arcpy.SpatialJoin_analysis("SEGMENTS", "ROUTES", "../SCRATCH.gdb/SJ", "JOIN_ONE_TO_MANY",..match_option="SHARE_A_LINE_SEGMENT_WITH")
arcpy.Statistics_analysis("SJ", "../SCRATCH.gdb/STATS", statistics_fields="TRAFFIC SUM", case_field="TARGET_FID")
arcpy.AddJoin_management("SEGMENTS", in_field="OBJECTID", join_table="STATS", join_field="TARGET_FID")

OUTPUT:

enter image description here

Solution will only work if your routes truly share segments and not drawn just close to accurate.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.