RE:Assigning Road Segments to Point Data
Sorry for not providing more info on the data. I have xy data for the location of 300 crahes. I had written twice before asking about analyzing point data. In both replies they said "that there are a number of ways to assign each road segment the accident data." I would like to try this solution. How would I go about doing this?
In previous emails I had also attached this map as an example of what I would like to try to do.
Assigning Road Segments to Point Data
I want to assign accident data to road segments. How do I do this?
This is a geocoding or a linear referencing issue first, rather than a cartography problem that we have resources to address. The solution will depend on the characteristics of your data, and to set your expectations, this is typically not an easy task. Data quality issues are frequently encountered and it really depends on what you want to do. When you write, "accident data", that implies to me that you do not have point locations for the accidents, which means that you cannot simply run something like a spatial join tool to find the nearest road line.
Mapping Center Answer:
We got your sample data and tested the workflow to achieve the results you are looking for, as shown in the PDF you attached to your question.
1) First, of all your road data is not topologically correct. What that means is that the roads do not split at the intersections. This needs to be the case so that each line segment of road between intersections is a unique feature. Then you can assign the accident data to the related road segment. To split the roads at the intersections, use the Feature To Line tool – this tool will create a feature class (or in your case shapefile) containing new lines generated by your original lines and splitting them at their intersections.
The one data issue that you may have is the fact that some accidents fall directly on the intersections of the road segments and will be counted for each road segment in that intersection. To take care of this, double check your data and make sure each accident is associated with one road segment.
2) Now that your road data are topologically correct, use the Spatial Join tool to transfer the attributes from the accidents feature class to the roads feature class. In your case, the Target features will be your roads line feature class and the Join Features will be your accidents points feature class. Select as the Join operation ‘JOIN_ONE_TO_ONE’. Using this option, if multiple Join Features are found that have the same spatial relationship with a single Target Feature, the attributes from the multiple Join Features will be aggregated. A column called Join_Count is added to the Target Features. Join_Count will record the number of accident matches per road segment. You may want to use a small search radius in case the accident points are not exactly on the roads. Once you have set the options, run the tool.
3) Now that you have the Join_Count attribute that identifies the number of accidents for each road segment, you can use it to symbolize the roads so that segments with more accidents are wider than those with less. To do this, use the Quantities - Graduated symbols renderer on the Symbology tab of the Layer Properties for the roads feature class. Set the symbol size values to reflect what your want your narrowest and widest roads to look like – the others will be scaled appropriately between these extremes.
4) You can also label the roads with the accident count if you want to. On the Labels tab of the Layer Properties, the Label Field would be Join_Count. To achieve results like those shown below, on the Labels tab, click Symbol, then click Edit Symbol, and on the Advanced Text tab, check the option to use a Text Background. Then you can set the symbol properties for the background.
If you would like to post a comment, please login.