On Wed, 31 May 2006, Patrick Giraudoux wrote: > Dear Listers, > > The function areapl() of the package splancs computes polygon areas in > the coordinate units. This means in square meters when using UTM or > Lambert projections but in "square degrees" when using longlat degrees. > > Does anybody knows a R function (or an algorithm) to compute the area > directly (without projecting or projecting internally), eg in square > meters, of a polygon whose node coordinates are given in decimal degrees?
I think it could be done internally in the sp/src/Rcentroid.c function if Area2() was rewritten to call sp_gcdist() on each of the four segments in: area = (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]); but it would only be acceptable for larger areas. As it is, the area of SpatialPolygons objects is really only used to create the plot order (to plot larger polygons before smaller ones). In fact we only have the measurement at the Polygon object level sensibly - above that we don't really know whether multiple polygons in a Polygons object are holes or not, so summing the component Polygon object areas in a Polygons object may be wrong. Roger > > Thanks for any hint, > > Patrick > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: [EMAIL PROTECTED] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo