Skip to content

How can I convert a "SpatialPolygons" object, to a "polylist"?

1 message · Patrick Giraudoux

#
if your SpatialPolygons name is e.g. myObject

lapply(myObject at polygons, function(x) x at Polygons[[1]]@coords)

should make it in the very simple case (the most common too anyway)
where each attribute line corresponds to one single polygon. It will
provide you with a list whose elements will be the coordinates of each
polygon.

More complex cases are a bit more difficult to handle

Patrick