Skip to content
Prev 14780 / 29559 Next

rgeos::gArea() to all polygons within sp polygons DF

When working with polygons with holes sp objects do not necessarily contain information on which holes belong to which polygons which is something that rgeos needs to know to properly calculate properties like area.

You can use the createSPComment function to use rgeos to assign holes to polygons which will create the comment attribute mentioned in the warning.

I believe the area slot of the Polygons object also ignores any holes and so it should match the result from gArea when ignoring orphaned holes as well, but this is the area of the containing polygon not the area of the containing polygon - area of any holes.

-Colin
On Apr 9, 2012, at 11:12 AM, Agustin Lobo wrote: