centr {fastshp}R Documentation

Compute shape centroids and areas.

Description

centr computes centroids and areas of shapes

Usage

centr(shp)

Arguments

shp

shapefile object as returned by read.shp(..., type='list') or a list of coordinate vector pairs, i.e., list(shape1=list(x, y), shape2=list(x, y), ...) where each coordinate vector is a real vector

Value

Data frame with columns:

cx

x coordinate of the centroid

cy

y coordinate of the centroid

area

area of the shape

Note

If a shape has more than one part, only the centroid and area of the first part is computed, subsequent parts are discarded with a warning.

See Also

read.shp


[Package fastshp version 0.1-0 Index]