# Calculating angles using ArcGIS Desktop 10.2

19939
32
01-21-2016 11:17 AM
New Contributor II

I need to find angles of streets where they intersect with roadways covering the entire state. Does anyone have a method and/or tools in mind?

1 Solution

Accepted Solutions
Regular Contributor III

Attached is a model that should accomplish what you are trying to do.If you'll add your streets layer and leave the defaults it should produce a point file at each intersection that has an angle between 5 and 40. I made these parameters so they could be adjusted, the other distance field is how far back from the intersection do you want to check the angle, 50 was used you may want smaller. The model will need an Advanced license to run.

32 Replies
Regular Contributor III

if you have an Advanced License you could use the Near—Help | ArcGIS for Desktop

New Contributor II

Thanks for the help Wes!

It looks as though this tool returns angle values in relation to North, South, East, or West. I am looking for a method that returns an angle where 2 lines intersect. In addition, I have a least a few hundreds of thousands of intersecting lines to measure those angles... We are trying to find all the intersecting roadways in the state that are at an angle of less than 40 degrees, where they intersect, and run crash rates and analyses. Do you still think this tool will do the job of measuring those angles?

Thanks again for the prompt response!

MVP Emeritus

You might want want to move this to Geoprocessing GeoNet Community Structure  this space is for help on GeoNet and how to use it.

Regular Contributor III

Attached is a model that should accomplish what you are trying to do.If you'll add your streets layer and leave the defaults it should produce a point file at each intersection that has an angle between 5 and 40. I made these parameters so they could be adjusted, the other distance field is how far back from the intersection do you want to check the angle, 50 was used you may want smaller. The model will need an Advanced license to run.

New Contributor II

Wes,

Thanks!

I ran the model and it failed with this error:

Assembling Features...
Succeeded at Mon Jan 25 11:06:26 2016 (Elapsed Time: 2 minutes 4 seconds)
Executing (Generate Near Table): GenerateNearTable in_memory\roadsIntersect in_memory\Roads_Intersect_Buffer_Inter in_memory\nearTable "51 Feet" NO_LOCATION ANGLE ALL 0 PLANAR
Start Time: Mon Jan 25 11:06:27 2016
Determining data processing extents...
Building a neighborhood index from the Near Features...
Generating Near Table...
Found 346 feature(s) within 51.000000
Succeeded at Mon Jan 25 11:06:27 2016 (Elapsed Time: 0.56 seconds)
Executing (findLessThanAngle): findLessThanAngle 50 5 in_memory\roadsIntersect in_memory\nearTable
Start Time: Mon Jan 25 11:06:27 2016
Running script findLessThanAngle...
Failed script findLessThanAngle...

Traceback (most recent call last):
File "Y:\GISData\Tools\FindAngletoolbox\findAngle.tbx#findLessThanAngle.py", line 37, in <module>
NameError: name 'each' is not defined

Failed to execute (findLessThanAngle).
Failed at Mon Jan 25 11:06:28 2016 (Elapsed Time: 0.23 seconds)

I deleted the "each" out of the python code, ran it, but it only gave me 22 intersecting roadways with angles of < than 50 degrees out of 2299 total...I wasn't sure if it was my python code editing that gave me the short list.

I  know very little about python. It is in my toolbox of things to do, no pun intended.

Other than that, it does look promising!

Regular Contributor III

Would you be willing to share a portion of your data? 22 is far less than i expected for a state wide search. I'll check the code against your data. I tested this code against county data and returned over 200.

New Contributor II

Wes,

Sorry for the delayed response. Been kind of busy.

Yes, I have attached a county with a roadway layer here. I have tried running the model several more times and now I cannot get any results at all to show in the table of contents. Did I mess something up?

I have also attached the model again here to verify whether or not I have corrupted it... I even tried removing the original model and reinstalling it into the "Toolbox" in ArcMap...

Thanks,

Brian

New Contributor II

The last reply didn't have an "attach" tool located on it...

Attached is a county dataset. As I said earlier, the model will not offer any results on this county either, although it does run and complete.

I have also attached here again the "findAngle" tool to check if I have corrupted it...