[R] Does the "labpt" object in the Polygons-class represent the centroid of the polygon

Roger Bivand Roger.Bivand at nhh.no
Fri Feb 6 14:59:30 CET 2009

 <Rizzo.Michael <at> epamail.epa.gov> writes:

> I need to calculate the centroids of some spatial polygons that I have
> placed into a Polygons-class object.  Is the labeling point in the
> Polygons-class the centroid of the polygon?

Yes. The class documentation at ?"Polygons-class" does not state that this is 
the case, because other points might be validly inserted as label points. The 
default constructor uses the centroid of the largest non-hole ring in the 
Polygons object.

Roger Bivand

> Thank you for your help.

More information about the R-help mailing list