[R-sig-Geo] Centroids and getSpPPolygonsLabptSlots

Roger Bivand Roger.Bivand at nhh.no
Mon Oct 29 21:06:25 CET 2007


On Mon, 29 Oct 2007, Agustin Lobo wrote:

> I have just incidentally learned in the sp doc that
> getSpPPolygonsLabptSlots() actually retrieves the coordinates
> of the centroids. The index page of the sp doc just states:
> getSpPPolygonsLabptSlots 	Class "SpatialPolygonsDataFrame"
>
> adding a mention to the fact that getSpPPolygonsLabptSlots retrieves the
> coordinates of the centroids would be very helpful. Previously, I
> thought I had to convert to a PBSmapping object and use calcCentroid().

And coordinates(x) returns the same points for x a 
SpatialPolygonsDataFrame (strictly the centroids of the largest component 
polygon by area, with no guarantee that it does not fall in a hole in that 
polygon. The very long names are just wrappers for losts of nested slot() 
and sapply() calls.

The documentation weaknesses are obvious, but are hard to address, because 
the sp package itself has little example data - there is more in maptools 
- and because new style classes and methods for them are harder to 
document than old style classes and methods. I'll try to make the 
documentation simpler and easier to search.

Roger

>
> Agus
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list