Calculate the Length of Polylines
Calculate the length of polylines found in a PolySet.
calcLength (polys, rollup = 3, close = FALSE)
polys |
PolySet to use. |
rollup |
level of detail in the results; |
close |
Boolean value; if |
If rollup equals 1, the results contain an entry for
each unique PID only. Setting it to 3 prevents roll-up,
and they contain an entry for each unique (PID, SID).
If the projection attribute equals "LL", this routine uses
Great Circle distances to compute the surface length of each polyline.
In doing so, the algorithm simplifies Earth to a sphere.
If the projection attribute equals "UTM" or 1, this
routine uses Pythagoras' Theorem to calculate lengths.
Nicholas M. Boers, Associate Professor – Computer Science
MacEwan University, Edmonton AB
Last modified Rd: 2013-04-10
local(envir=.PBSmapEnv,expr={
#--- load the data (if using R)
if (!is.null(version$language) && (version$language=="R"))
data(nepacLL,envir=.PBSmapEnv)
#--- calculate the perimeter of Vancouver Island
print(calcLength(nepacLL[nepacLL$PID==33, ]))
})Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.