Skip to contents

This function allows you to interactively edit features in a shapefile using the mapedit package.

Usage

shapefile_edit(
  shapefile,
  mosaic = NULL,
  basemap = NULL,
  r = 3,
  g = 2,
  b = 1,
  max_pixels = 3e+06
)

Arguments

shapefile

A shapefile (sf object) that can be created with shapefile_input().

mosaic

Optionally, a mosaic (SpatRaster) to be displayed as a background.

basemap

An optional mapview object.

r

Red band index for RGB display (default is 3).

g

Green band index for RGB display (default is 2).

b

Blue band index for RGB display (default is 1).

max_pixels

Maximum number of pixels for down-sampling the mosaic (default is 3e6).

Value

A modified shapefile with user-edited features.

Examples

if (interactive() && requireNamespace("EBImage")) {
library(pliman)
shp <- shapefile_input(system.file("ex/lux.shp", package="terra"))
edited <- shapefile_edit(shp)
}