R/tb_digitize.R
digitize.Rd
digitize is based on the leaflet draw plugin. It provides a bunch of leaflet maps as base layers for digitizing vector features.
digitize(
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,
features = NULL,
preset = "all",
locPreset = "muf",
cex = 10,
lwd = 2,
alpha = 0.6,
opacity = 0.7
)
c(lat,lon) central point of the leaflet map
initial zoom level
enable the draw tool line tool
enable the draw polygon tool
enable the draw polygon tool
enable the draw circle tool
enable the draw point tool
enable/disable the remove feature of the draw tool
place to put the toolbar (topright, topleft, bottomright, bottomleft)
string. as provided by leaflet-provider
optional sp object
features
character. defaut is "NULL" full draw version, "uav" for flightarea digitizing, "ext" for rectangles
character. default is "muf" for Marburg University Forest, others are "tra" Traddelstein, "hag" Hagenstein, "baw" Bayerwald.
cex
lwd
alpha
opacity
You can either save the digitized object to a JSON
or KML
file to your hard disk. As an alternative you may grab the JSON
string via the clipboard.
if (FALSE) {
##- libs
require(sp)
require(uavRst)
##- preset for digitizing uav flight areas in Meuse
require(sp)
data(meuse)
sp::coordinates(meuse) <- ~x+y
sp::proj4string(meuse) <-sp::CRS("+init=epsg:28992")
me<-sp::spTransform(meuse,CRSobj = sp::CRS("+init=epsg:4326"))
uavRst::digitize(overlay = me)
##- preset for digitizing extents
uavRst::digitize(preset="ext",overlay = me)}