Skip to content
Prev 8898 / 29559 Next

Determine angle between polyline segments

Hello,

Have you considered using the 'adehabitat' package? It presents classes 
and tools for the analysis of trajectories, and automagically computes 
absolute and relative angles. I'm not that familiar with polylines (in 
ArcGIS or sp) so that I don't have a working example at hand, but you'd 
have to extract coordinates of the polylines to build a ltraj object 
(using as.ltraj), keeping the ID of the line as the ID of the ltraj, and 
with 'typeII = FALSE' which means that you don't have the exact date.

In the end, an object of class ltraj is a list with a data frame for 
each element of the list (for you a line), which gives you both kind of 
angles among other variables (dx, dy, dist, etc.).

Hope this helps,
Mathieu.


Le 30/07/2010 03:33, Rainer M Krug a ?crit :