[R-sig-Geo] how to calculate areas of shape files using R

Robert Hijmans r.hijmans at gmail.com
Tue Feb 1 08:58:11 CET 2011


> A small caveat - if the coordinates are planar, the explanation holds, if 
> geographical (degrees), it doesn't. The naive area values have been used 
> internally to plot larger Polygon objects before smaller Polygon objects, 
> to avoid overplotting in earlier versions of R that did not "identify" 
> holes automatically. So first make sure that you have planar coordinates, 
> otherwise the "area" values have no metric. If need be, project with 
> spTransform() methods in rgdal

If the coordinates are spherical (in degrees) you can compute the area of
polygons in a SpatialPolygons* object like this: 

library(geosphere)
areaPolygons(object) 

-- 
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/how-to-calculate-areas-of-shape-files-using-R-tp5975749p5980100.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list