Skip to content

Determine angle between polyline segments

3 messages · Rainer M Krug, Nikhil Kaza, Mathieu Basille

#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

a friend of mine wants (needs?) to determine the angle between segments
in an ESRI polyline (line vector feature). As there does not seem to be
an easy way in ArcGIS 9.2, I thought about askeng here:

Is there way of calculating these angles between the different line
segments in R (after importing the line feature into R)?

Thanks,

Rainer

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxSgFYACgkQoYgNqgF2egp34ACeMiVR1XG9xb/YH7KpFJ+3jTln
5WUAn3Cxbl1BCr9iSidDFYcmwdiiYhFh
=P2Jq
-----END PGP SIGNATURE-----
#
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 :