calcperimeter | R Documentation |
calcperimeter
computes the perimeters of polygons in objects of
class SpatialPolygonsDataFrame
and PolyLinesDataFrame
.
calcperimeter(x)
x |
object of class |
an object of class SpatialPolygonsDataFrame
or
PolyLinesDataFrame
with an additionnal column containing the
perimeter of the polygons/polylines.
Clement Calenge clement.calenge@ofb.gouv.fr
SpatialPolygonsDataFrame-class
for
additionnal information on objects of class
SpatialPolygonsDataFrame
.
data(meuse.grid)
a <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")],
data = meuse.grid)
## the contour of the map
gc <- getcontour(a[,1])
plot(gc)
## Transforms the SpatialPolygons into SpatialPolygonsDataFrame
gc <- SpatialPolygonsDataFrame(gc, data.frame(x=1))
## The perimeter of this map (in units of the data):
ii <- calcperimeter(gc)
as.data.frame(ii)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.