Calculates the perimeter length(s) for a polygon object
polyPerimeter(x)
x | sp class SpatialPolygonsDataFrame object |
---|
A vector of polygon perimeters
Jeffrey S. Evans <jeffrey_evans@tnc.org>
library(sp) p1 <- Polygons(list(Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2)))), "1") p2 <- Polygons(list(Polygon(cbind(c(5,4,2,5),c(2,3,2,2)))), "2") p3 <- Polygons(list(Polygon(cbind(c(4,4,5,10,4),c(5,3,2,5,5)))),"3") polys <- SpatialPolygons(list(p1,p2,p3), 1:3) polyPerimeter(polys)#> [1] 9.634414 6.650282 15.245165