Learn R Programming

IceCast (version 2.1.0)

rm_holes: Remove holes in a polygon

Description

Remove holes from a SpatialPolygons object. Note that this function differs from the function findHoles in that it only removes holes contained within the polygon itself, not gaps between the polygon and region boundaries

Usage

rm_holes(my_poly, poly_name = "notSpecified")

Arguments

my_poly

SpatialPolygon object

poly_name

character string to name polygon (defaults to "notSpecified")

Value

SpatialPolygon object with holes removed

Examples

Run this code
# NOT RUN {
with_holes <- bg_water[2]
plot(with_holes, col = "blue", main = "Polygon with Holes")
no_holes <- rm_holes(with_holes)
plot(no_holes, col = "blue", main = "Holes removed")
# }

Run the code above in your browser using DataLab