I converted a raster
with 4 classes to a SpatialPolygonsDataFrame
, where the features representing a class are not always connected. I used disaggregate
(package sp) to get single features.
I now want to get rid of all those features, smaller than 3000 m². I already generated the area with poly.areas
(package GISTools) and added the info as attribute to the Shapefile.
The small features should be merged with their surrounding feature.
Has anyone an idea how to solve this? unionSpatialPolygons
does only work with IDs, not conditions of attributes.