[R-sig-Geo] invalid geometries from negative buffering in rgeos/sp

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Thu Oct 3 15:45:17 CEST 2013


On Thu, Oct 3, 2013 at 2:29 PM, Roger Bivand <Roger.Bivand at nhh.no> wrote:

> Yes, but ...
>
> The user gets a SpatialPolygonsDataFrame object with the data slot intact,
> but some of the polygons are clearly now invalid. Should we do
> book-keeping to only retain the data slot rows for valid polygons, only
> return the subset of valid polygons, or proceed as now, and have the user
> do:
>
> plot(b[gArea(b, byid=TRUE) > 0,])
>
> What makes more sense? I'm open to suggestions ...

 I'm first wondering what the source of the invalidity is here. What
does the underlying GEOS code return from one of these operations?
Does it have a valid NULL polygon feature concept? If so, then I'd
like to see that carried through into sp-class objects.

 Its not a sufficient condition that the area = 0 - a polygon of three
coincident points has area=0, but a big negative buffer should be a
geometry without even points in it...

Barry



More information about the R-sig-Geo mailing list