Skip to content
Prev 20729 / 29559 Next

Singlepart to multipart

On Tue, 1 Apr 2014, Jonathan Greenberg wrote:

            
Crucially, and typically for me, what do you mean by "polygon"? Do you 
mean SFS POLYGON (one exterior ring and zero or more interior rings aka 
holes), or Polygon as defined in sp, which is a linear ring either hole or 
non-hole? I suspect the former, but the answers would differ.

The IDs on the Polygons objects (features) are tied to rows in the data 
frame, so you are breaking up each Polygons object either to the lowest 
level of each component linear ring irrespective of its hole status, or, 
more likely, to that of each constituent SFS POLYGON. Something like this 
happens as Polygons objects enter GEOS, but there such a Polygons object 
may go to MULTIPOLYGON (multiple exterior rings) or POLYGON (single 
exterior ring) as encoded in the comment attribute of Polygons objects 
(yes, a nasty kludge, knowing about SFS postdated the definition of 
polygon vector objects in sp). Some mechainsm for assigning ID values 
would also be needed.

Roger