[R-sig-Geo] Cleaning small spatial polygons

Eduardo Diez eduardodiez at gmx.com
Fri Oct 16 19:43:56 CEST 2015


Dear list,
I'm willing to know if any knows a way of performing tha same thing i'm
doing through rgrass7 with GRASS when I execute the function v.clean with
"rmarea" as the tool argument. That is:

"The rmarea tool removes all areas <= thresh. The longest boundary with an
adjacent area is removed or all boundaries if there is no adjacent area.
Area categories are not combined when a small area is merged with a larger
area."

Basically i have raster of zones within a field. I convert it to
SpatialPolygonsDataFrame and in order to leave only the more
important/meaningful ones i remove the small/sliver with this tool. In
general it works fine but having to call an external software with a
specific version makes the script less portable and you have to be careful
with updates and such. Also you have to write rasters and shapefiles back
and forth as GRASS can't work with in-memory objects.

Does someone know a way of doing this in plain R?

Thanks

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list