Jump to content

 
Photo

Counting Angles

- - - - -

  • Please log in to reply
12 replies to this topic

#1
David25

David25

    Key Contributor

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

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

Kathi

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 196 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

Sv_BG

    Contributor

  • Validated Member
  • PipPip
  • 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

David25

    Key Contributor

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

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.

Can you advise some more?

Thanks.

#5
Sv_BG

Sv_BG

    Contributor

  • Validated Member
  • PipPip
  • 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

David25

    Key Contributor

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

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

Sv_BG

    Contributor

  • Validated Member
  • PipPip
  • 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

Sv_BG

    Contributor

  • Validated Member
  • PipPip
  • 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

David25

    Key Contributor

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

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

Sv_BG

    Contributor

  • Validated Member
  • PipPip
  • 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

Laura Miles

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 116 posts
  • Canada

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

Sv_BG

    Contributor

  • Validated Member
  • PipPip
  • 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 :(

David, sorry for misleading you.

#13
David25

David25

    Key Contributor

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

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

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

David, sorry for misleading you.


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

-->