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
)

Arguments

mapCenter

c(lat,lon) central point of the leaflet map

zoom

initial zoom level

line

enable the draw tool line tool

rectangle

enable the draw polygon tool

poly

enable the draw polygon tool

circle

enable the draw circle tool

point

enable the draw point tool

remove

enable/disable the remove feature of the draw tool

position

place to put the toolbar (topright, topleft, bottomright, bottomleft)

maplayer

string. as provided by leaflet-provider

overlay

optional sp object

features

features

preset

character. defaut is "NULL" full draw version, "uav" for flightarea digitizing, "ext" for rectangles

locPreset

character. default is "muf" for Marburg University Forest, others are "tra" Traddelstein, "hag" Hagenstein, "baw" Bayerwald.

cex

cex

lwd

lwd

alpha

alpha

opacity

opacity

Note

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.

Author

Chris Reudenbach

Examples

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)}