centr: Compute shape centroids and areas.

Description Usage Arguments Value Note See Also

View source: R/centr.R

Description

centr computes centroids and areas of shapes

Usage

1
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


s-u/fastshp documentation built on May 28, 2019, 10:47 a.m.