## Introduction

I was part of a group project that involved categorizing, grouping and labeling all the road intersections and interchanges of the county. I was responsible for developing the milestones of the project and the timeline for when each milestone needed to be started and completed. The first milestone of the project was to calculate the smallest angle formed by the roads of an intersection. Drawing on the ideas posted in this GIS Stack Exchange discussion, I created my own version of the workflow necessary to calculate the smallest angle of a road intersection.

The complexity of the overall project, and having several members on the group, made it beneficial to invest time developing a system of documentation to be used during the group project. These are some of the charts and graphics I created for our group.

## GIS Work

The smallest angle for each intersection was calculated using the coordinates of the center of the intersection and the coordinates along each road, 30cm away from the center. A table containing all these coordinates was created from the outputs of many tools in ArcMap. These tool outputs were joined together, and the results saved as the Intersection_XY table.

The Intersection_XY table provides the data needed to find the angle between roads at an intersection. The process used involves first calculating the degree bearing that each road leaves the intersections. The difference between the degree bearing of any two roads is equal to angle in degrees between them.

The following Python code was used to calculate the bearing of each road as it leaves the center of the intersection. The math for the conversion of angle given by atan2 to bearing degree was derived by trial and error. The approach taken was to convert from degrees counter-clockwise (atan2’s output) to degrees clockwise (bearing) by adding or subtracting 180°. North starting at 0° required a rotation by 90°. The angle formed between any road of an intersection was then found by taking the difference between the bearings of those roads.

```def get_bearing(xy1, xy2):
x1, y1 = xy1
x2, y2 = xy2
dx = x2 - x1
dy = y2 - y1