sp_punch: Function to "punch" (add/insert) a hole in a polygon.

View source: R/sp_punch.R

sp_punchR Documentation

Function to "punch" (add/insert) a hole in a polygon.

Description

Punching could also be called a reverse-clip or an erasing process.

Usage

sp_punch(sp_base, sp_hole, features = FALSE)

Arguments

sp_base

SpatialPolygons which will have a hole punched into it.

sp_hole

SpatialPolygons which will be represented as a hole in sp_base.

features

Should sp_punch be applied across all features in sp_base?

Author(s)

Stuart K. Grange

Examples

## Not run: 
# Load coastline
sp_uk <- sp_read("uk_coastline")

# Load a drawn polygon
data_drawn <- read.delim("drawn_polygon.txt")

# Promote to spatial
sp_drawn <- data_frame_to_polygon(data_drawn)

# Punch a hole in the coastline object
sp_uk_punch <- sp_punch(sp_uk, sp_drawn)

# Check
plot(sp_uk_punch)


## End(Not run)


skgrange/gissr documentation built on Feb. 24, 2024, 2:55 p.m.