vecDraw is designed for straightforward digitizing of simple geometries without adding attributes. It provides a bunch of leaflet base maps and optionally a sf* object can be loaded for orientation.
vecDraw(
mapCenter = NULL,
zoom = 15,
line = TRUE,
rectangle = TRUE,
poly = TRUE,
circle = TRUE,
point = TRUE,
remove = TRUE,
position = "topright",
maplayer = c("CartoDB.Positron", "OpenStreetMap", "Esri.WorldImagery",
"Thunderforest.Landscape", "OpenTopoMap"),
overlay = NULL,
preset = "all",
locPreset = "muf",
cex = 10,
lwd = 2,
opacity = 0.7
)
center of the leaflet map
set initial zoom level of leaflet map
enable/disable line tool
enable/disable polygon tool
enable/disable polygon tool
enable/disable circle tool
enable/disable point tool
enable/disable the remove feature of the draw tool
toolbar layout (topright, topleft, bottomright, bottomleft)
string as provided by leaflet-provider
optional sp* object may used for orientation
character default is "uav" for line based mission digitizing, "ext" for rectangles, NULL for all drawing items
character location preset, default is "muf" for Marburg University Forest, "tra" Traddelstein, "hag" Hagenstein, "baw" Bayerwald.
size of item
line width of item
opacity of item
Yu can either save the digitized object to a json (JS) or kml (KML) file.
if (FALSE) {
# fully featured without overlay
require(mapview)
# preset for digitizing uav flight areas using Meuse data set as overlay
require(sp)
data(meuse)
sp::coordinates(meuse) <- ~x+y
sp::proj4string(meuse) <-CRS("+init=epsg:28992")
m <- sp::spTransform(meuse,CRSobj = sp::CRS("+init=epsg:4326"))
vecDraw(overlay = m, preset = "uav")
# preset for digitizing simple rectangles extents
vecDraw(preset="ext",overlay = m)
}