Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

draw

Draw a polygon, line, extent, or points


Description

Draw on a plot (map) to get a SpatVector or SpatExtent object for later use. After calling the function, start clicking on the map. When you are done, press ESC. You can also preset the maximum number of clicks.

Usage

## S4 method for signature 'character'
draw(x="extent", col="red", lwd=2, id=FALSE, n=1000, ...)

Arguments

x

character. The type of object to draw. One of "extent", "polygon", "line", or "points"

col

the color to be used

lwd

the width of the lines to be drawn

id

logical. If TRUE, a numeric ID is shown on the map

n

the maximum number of clicks (does not apply when x=="extent" in which case n is always 2

...

additional graphics arguments for drawing

Value

SpatVector or SpatExtent

See Also


terra

Spatial Data Analysis

v1.2-10
GPL (>= 3)
Authors
Robert J. Hijmans [cre, aut] (<https://orcid.org/0000-0001-5872-2872>), Roger Bivand [ctb] (<https://orcid.org/0000-0003-2392-6140>), Karl Forner [ctb], Jeroen Ooms [ctb] (<https://orcid.org/0000-0002-4035-0289>), Edzer Pebesma [ctb] (<https://orcid.org/0000-0001-8049-7069>)
Initial release
2021-05-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.