Suite of interactive functions and helpers for selecting and editing geospatial data.
Interactive editing of spatial data in R | an RConsortium funded project. For additional detail, please see the original proposal.
mapedit
is still in active development. We would very much appreciate feedback, ideas, and use cases. The API has stabilized, but please be aware that the API might change over the next couple of months. We will use semantic versioning with Github tagged releases to track changes and progress. All changes will also be documented in NEWS.md.
Introduction to mapedit - January 30, 2017
mapedit updates in 0.2.0 - June 12, 2017
Tim Appelhans at useR 2017 - July 2017
As the CRAN badge above indicates, mapedit
has achieved CRAN status. To install, please use install.packages
, or for the cutting edge, use devtools::install_github
.
install.packages("mapedit")
# cutting edge
# devtools::install_github("r-spatial/mapedit")
We can interactively CRD (create, update, delete) features on a map with editMap
.
library(mapedit)
library(leaflet)
library(mapview)
editMap(leaflet() %>% addTiles())
editMap(
mapview(breweries91),
targetLayerId = "breweries91"
)
mapedit
also offers interactive selection of map features with selectMap
.
library(mapedit)
library(leaflet)
library(mapview)
selectMap(
leaflet(breweries91) %>%
addTiles() %>%
addCircleMarkers(layerId = ~brewery)
)
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
This project has been realized with financial support from the
editor = "leafpm"
to draw*()
and edit*()
functions to use the Leaflet.pm
pluging for editing. Leaflet.pm
provides support for creating and editing holes, snapping, and integrates better with some multi*
features. Note, mapedit
now offers two editors "leaflet.extras"
and "leafpm"
, since each have advantages and disadvantages.stopApp when session ended to handle when a user closes a browser tab or window when using viewer = browserViewer(browser = getOption("browser"))
add circleMarkerOptions for Leaflet.draw
warn when feature drawn outside of -180, 180
fix precision to match new Leaflet 6 digits
expose title argument to editFeatures and drawFeatures
edit
module lookup for already added Leaflet.draw
add drawing mode to selectFeatures to enable selection via point/line/polygon drawing. Selection will be done using any of ?geos_binary_ops
; thx @tim-salabim
add CRS
in edit*
functions; thx @tim-salabim
add label for reference in edit*
and select*
add title argument for editMap()
automatically close browser window on Shiny session end when using
viewer = browserViewer(browser = getOption("browser"))
add new function drawFeatures
polygons of length > 1
not handled correctly. See discussion.
remove internally added edit_id
column in editFeatures return
cast edits back to their original type. See discussion
fix merge_edit to only consider last edit when there are multiple edits per layerId
sf
; thanks @tim-salabim for identifyingrecord = TRUE
then a "recorder"
attribute will be added to the returned object for
full reproducibility.combine_list_of_sf
with length 0 list
; found when editFeatures()
and save with no changesAPI breaking change
editMap
and selectMap
dplyr
sf
edit_map()
now returns sf
instead of geojson
by default. Toggle
behavior with the sf
argument.