Skip to content
Prev 1056 / 29559 Next

Computing polygon area with decimal degree coordinates

On Wed, 31 May 2006, Patrick Giraudoux wrote:

            
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