Hi,

I am trying to split groups of points that intersect polylines, but I cannot seem to find a tool that can perform the task. I have performed a spatial join with a one-to-many relationship so that all of the points now have the [Roads.ID] value stored in [Points.RoadsID] field where they intersect.

Here is a sample of my data: -

[Roads.ID]

[Roads.Name]

[Roads.Shape_Length]

[Points.ID]

[Points.RoadsID]

[Points.Speed]

What I would like to do is split the [Points] table up into groups of points that all have the same [Points.RoadsID] value so I can perform statistical analysis on them on a road-by-road level.

Any help would be appreciated,

Thanks,

Liam.

I am trying to split groups of points that intersect polylines, but I cannot seem to find a tool that can perform the task. I have performed a spatial join with a one-to-many relationship so that all of the points now have the [Roads.ID] value stored in [Points.RoadsID] field where they intersect.

Here is a sample of my data: -

**[Roads]**[Roads.ID]

[Roads.Name]

[Roads.Shape_Length]

**[Points]**[Points.ID]

[Points.RoadsID]

[Points.Speed]

What I would like to do is split the [Points] table up into groups of points that all have the same [Points.RoadsID] value so I can perform statistical analysis on them on a road-by-road level.

Any help would be appreciated,

Thanks,

Liam.

You need to do either the Spatial Join or the Locate Features Along Routes tools first before you can process the Summary Statistics tool. I did not mean to eliminate the Spatial Join step. After doing the Spatial Join or LR tool, specify that you want the Mean Speed in the Summary Statistics tool to get that summary. See my sample Summary Statistics tool set up and output. In this example I have already processed the Locate Features Along Route tool and am getting the minimum, maximum and average (mean) speed of all LR event points associated to each Road_ID in a table with multiple points tied to multiple Road_IDs. The data is made up so don't worry about whether the values are realistic. This is just to illustrate the principle of what I am telling you to do.

For the Linear Referencing option, I assumed you would create your LR Routes using the RoadID field as the RouteID, so that the Locate Features on Routes tool would automatically include the Road_ID in the output. The Locate Features by Route is a replacement for doing a Spatial Join, but you would still need to do the Summary Statistics on the Locate Features by Route tool output. It is just that LR events do much more than Spatial Join Outputs.

Your code is unnecessary and inefficient by comparison with what I am proposing. Also the Python code I suggested would be much more efficient if it was adapted to do an average speed. It can be adapted to do the same as the summary table I have created, but for just one summary value (average speed) the Summary Statistics method is just about as efficient. The Python script option also assumes you have previously run the Spatial Join or the Locate Features Along Routes tool prior to running the script.