Search code examples
rrgdal

Calculus for the labpt slot of a SpatialPolygon object


The labpt slot of the SpatialPolygon object in the sp package is vaguely defined in the documentation as a point where a label is displayed for the polygon. I would like to know the calculation behind it and what are it's properties. Typically are we sure that it will be in the polygon or like a centroid it can be out of the polygon?

I found a function in the rgeos package computing a similarly named object but cannot figure out if it actually is the function used by sp.


Solution

  • It is the centroid of the polygon with minor adaptations as well described in this answer to a question about coordinates() which actually extract labpt from SpatialPolygon objects.