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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Rizzo.Michael

Hello,

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?

Thank you for your help.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Does the "labpt" object in the Polygons-class represent the centroid of the polygon

Roger Bivand
 <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.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Roger Bivand
Department of Economics
NHH Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway