How to sum points on a line and add value to the line attributes?

2335
7
Jump to solution
11-10-2011 10:50 AM
DavidMedeiros
Occasional Contributor III
I have what is probably a simple operation to complete in Arc but am unsure of the exact functions or tools to use.

I have two feature classes, a set of points (dam locations) and a set of lines (river network). For each section of river I want to add an attribute that is the sum of all dams on that section of river.

This seems like a simple operation but I can't quite figure it out in Arc. A spatial join will give me overlapped rerecords for each line-point combination (if one-to-many), but the collect-events tool is for points only so not sure how to recombine the lines and sum the number of points.

Any help is appreciated,

David
0 Kudos
1 Solution

Accepted Solutions
DanLee
by Esri Regular Contributor
Esri Regular Contributor
When you run Spatial Join, you can specify a Merge Rule - Count on a field. In your case, for each line you can get a count of matched dam features (FIDs).

View solution in original post

0 Kudos
7 Replies
DanLee
by Esri Regular Contributor
Esri Regular Contributor
When you run Spatial Join, you can specify a Merge Rule - Count on a field. In your case, for each line you can get a count of matched dam features (FIDs).
0 Kudos
DavidMedeiros
Occasional Contributor III
When you run Spatial Join, you can specify a Merge Rule - Count on a field. In your case, for each line you can get a count of matched dam features (FIDs).


Sorry for the late reply, thank you Dan, yes this worked great.
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Thank you for letting me know. You are welcome. I am glad it worked for you.  🙂
0 Kudos
DavidMedeiros
Occasional Contributor III
Thank you for letting me know. You are welcome. I am glad it worked for you.  🙂


I have a new similar question if you're interested?

I have 6 line feature classes, each one is of a particular fish species distribution in the Oregon river system. Each feature class contains only the line features where that species is present, some lines overlap between the 6 layers, some don't.

I want to output a new layer that is a collection of all the river segments from the 6 layers where each segment contains the count of the species in that segment and the unique species names. Union (Analysis) looks like it does what I want but this is a polygon only tool. I think I could do this thru a series of spatial joins to a master hydrology layer but a one time merging of the 6 line layers would work better. Any ideas how I could best tackle this analysis?
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
I think Featue To Line tool (ArcInfo license) breaks lines where they intersect or share a segment. Each output line carries the FIDs of all the sharing lines, or -1 for no sharing line with an input fc. You would need to add a field to the result and calculate the count of FIDs that are not -1 by an expression.
0 Kudos
DavidMedeiros
Occasional Contributor III
I think Featue To Line tool (ArcInfo license) breaks lines where they intersect or share a segment. Each output line carries the FIDs of all the sharing lines, or -1 for no sharing line with an input fc. You would need to add a field to the result and calculate the count of FIDs that are not -1 by an expression.


Again, thank you. That worked as well. I never look to these tools as geometry tools but should probably know more about them (meaning the "feature to..." tools). I did have to massage the table after words. There may be a more automated way of doing this but I simply used a series of selections and field calculations to change the values in each of my 6 FID fields to either a 1 or 0 then used the field calc to sum those into a new column.

Now looking at how to create an accumulation of values for each segment based on its location in the river network and the values of all downstream segments. This is going to be a lot more involved and complex so I'll just post a new topic.
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
You are welcome. I am glad it worked well. There are many "feature" related tools in Data Management - Features toolset that can be helpful in a workflow to get your data in the right stage for analysis. It would be a good idea to spend some time to learn about them and keep them in mind.  🙂

Good luck with your project!
0 Kudos