# Counting Angles

12 replies to this topic

### #1 David25 Posted 08 November 2010 - 08:46 PM

David25

Key Contributor

• Validated Member
• 70 posts
• Gender:Male
• Location:Calgary

Hi all,

I have a task to complete at work whereby I have to come up with the number of angles on one line. The degree of the angle is not specified, so just every angle there is.
Does anyone have an idea of the easiest way to do this?

Thank you.

PS: I am using ArcGIS 9.3 with an Info licence.

### #2 Kathi Posted 09 November 2010 - 02:15 AM

Kathi

Master Contributor

• Validated Member
• 211 posts
• Gender:Female
• Location:Olten, Switzerland
• Interests:geology, GIS, cartography, famlily, reading, cooking, travelling, gardening
• Switzerland

Hi all,

I have a task to complete at work whereby I have to come up with the number of angles on one line. The degree of the angle is not specified, so just every angle there is.
Does anyone have an idea of the easiest way to do this?

Thank you.

PS: I am using ArcGIS 9.3 with an Info licence.

Just to make sure I understand your task correctly: You are trying to determine how many times a given line changes direction. Correct?
You could simplify the line so that there are no vertices between the "corner" points, then count the number of vertices (minus two for the two end points). This should yield the number of direction changes or angles.

I'm not sure ArcGIS can do this, though probably with the ArcInfo licence it can. FME would certainly do the trick.
Hope this helps.
Cheers,

Kathi

### #3 Sv_BG Posted 09 November 2010 - 07:31 AM

Sv_BG

Contributor

• Validated Member
• 33 posts
• Gender:Male
• Location:Sofia
• Bulgaria

I'm not sure ArcGIS can do this, though probably with the ArcInfo licence it can.

Yes, it can. After simplifying the lines, you can turn them into points using this tool:

http://webhelp.esri......a_Management)

Than simply open the attribute table of the new feature class/shapefile to check the number of the points (you should minus the start and the end point for every line, like Kathi already mentioned).

Hope this helps,
Svetoslav

### #4 David25 Posted 09 November 2010 - 11:16 AM

David25

Key Contributor

• Validated Member
• 70 posts
• Gender:Male
• Location:Calgary

Thanks to you both, it's good to know there's a solution. But, I just tried Simplifying the line (something I haven't heard of before) and it creates a point feature class that is empty. Some other setting I tried creates a random point off of my line. I'm not understanding this.

Thanks.

### #5 Sv_BG Posted 09 November 2010 - 12:25 PM

Sv_BG

Contributor

• Validated Member
• 33 posts
• Gender:Male
• Location:Sofia
• Bulgaria

Can you send me (attach it here in the forum) a shapefile with the lines, so I can give it a try?

### #6 David25 Posted 09 November 2010 - 03:26 PM

David25

Key Contributor

• Validated Member
• 70 posts
• Gender:Male
• Location:Calgary

Can you send me (attach it here in the forum) a shapefile with the lines, so I can give it a try?

Actually, it's private data so I'd best not. But, in theory, a vertex would be created at every turn and then I just count them? I wonder why it didn't work. And I must 'simplify' the line first?

### #7 Sv_BG Posted 09 November 2010 - 03:43 PM

Sv_BG

Contributor

• Validated Member
• 33 posts
• Gender:Male
• Location:Sofia
• Bulgaria

If you have vertexes between the edge (turn) vertexes of your lines, you should simplify/smooth the lines to remove them, because otherwise when you turn the lines into points, you will have vertexes which were situated at the straight parts of the lines and are not edges. So you won't be able to count the edges correct.

But if all of the vertexes of your lines are edge vertexes, you can turn your lines into points without smoothing them.

But, in theory, a vertex would be created at every turn and then I just count them?

Lines are consisted of connected vertexes (two or more), so the vertexes at every turn are already there. You want to turn them (the turn vertexes) into points to count them.

### #8 Sv_BG Posted 09 November 2010 - 03:55 PM

Sv_BG

Contributor

• Validated Member
• 33 posts
• Gender:Male
• Location:Sofia
• Bulgaria

Check out this tool, it gives another counting solution

Simple tool, authored using ModelBuilder 9.3 SP1, to add a long integer field to a polygon or line feature class, and then populate it with the number of vertices for each feature. ArcGIS Desktop tool equivalent to ArcInfo Workstation's COUNTVERTICES command.

http://resources.arc...3A-6AEEE90830B0

Hope this helps,
Svetoslav

### #9 David25 Posted 09 November 2010 - 04:34 PM

David25

Key Contributor

• Validated Member
• 70 posts
• Gender:Male
• Location:Calgary

Check out this tool, it gives another counting solution

Simple tool, authored using ModelBuilder 9.3 SP1, to add a long integer field to a polygon or line feature class, and then populate it with the number of vertices for each feature. ArcGIS Desktop tool equivalent to ArcInfo Workstation's COUNTVERTICES command.

http://resources.arc...3A-6AEEE90830B0

Hope this helps,
Svetoslav

So which tool in ArcInfo do I need? 'Simplify Line' doesn't appear to be the right one.

Thanks so much for your help.

### #10 Sv_BG Posted 09 November 2010 - 05:02 PM

Sv_BG

Contributor

• Validated Member
• 33 posts
• Gender:Male
• Location:Sofia
• Bulgaria

Ok, so till now we've figured out that there are two ways to count the turn/edge vertexes of your lines.

- to turn them into points (with feature to point tool from Arctoolbox), and simply check the number of points in the new feature class/shapefile.

- to use the tool you can download from here ( http://resources.arc...3A-6AEEE90830B0 ) in order to produce a field in your line feature class with the number of the vertexes for each line.

In both cases don't forget to minus the 2 end vertexes for each line from the count.

I explained why you should remove the vertexes which are situated on straight portions of your lines and are not turns/edges. If there are no such vertexes, there is no need to smooth anything.

That's what you need. Good luck,
Svetoslav

### #11 Laura Miles Posted 15 November 2010 - 03:46 PM

Laura Miles

Master Contributor

• Validated Member
• 116 posts

I don't think you really need to simplify the line...you said you want to count every direction change, correct? You can convert the line to points, and take the number of points from the attribute table, minus two for the end points. Feature to Point will not place points at the vertices but in the middle of the line, so I wouldn't use that. The ArcInfo tool you need is Feature Vertices to Points.
Laura

### #12 Sv_BG Posted 16 November 2010 - 04:58 AM

Sv_BG

Contributor

• Validated Member
• 33 posts
• Gender:Male
• Location:Sofia
• Bulgaria

The ArcInfo tool you need is Feature Vertices to Points.
Laura

You are right, yours is the right tool, my bad

### #13 David25 Posted 16 November 2010 - 08:53 PM

David25

Key Contributor

• Validated Member
• 70 posts
• Gender:Male
• Location:Calgary

The ArcInfo tool you need is Feature Vertices to Points.
Laura

You are right, yours is the right tool, my bad

Thank you! I will try that.

Thanks Sv_BG, I appreciated your replies.

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->