Interactive Editing of Spatial Data in R

Suite of interactive functions and helpers for selecting and editing geospatial data.


mapedit

CRAN_Status_Badge

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.

Blog Posts

Introduction to mapedit - January 30, 2017

mapedit updates in 0.2.0 - June 12, 2017

Talks

Tim Appelhans at useR 2017 - July 2017

Install

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

Examples

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

Code of Conduct

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.

Acknowledgment

This project has been realized with financial support from the

News

mapedit 0.3.2

Bug Fix

  • 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

mapedit 0.3.1

Bug Fix

  • multiple edits and deletes resulting in multiple FeatureCollections not handled properly causing some actions to not be considered when converting to sf; thanks @tim-salabim for identifying

mapedit 0.3.0

API Changes

  • BREAKING editFeatures and selectFeatures add a map argument instead of platform

New Features

  • add editFeatures function for easy add, edit, delete with existing simple features (sf)
  • add editMap.NULL
  • add record argument to edit* functions to preserve the series of actions from an editing session. If record = TRUE then a "recorder" attribute will be added to the returned object for full reproducibility.
  • add internal playback for recorded session for future use
  • add viewer argument to select and edit functions to allow user the flexibility to adjust the viewer experience. Default will be paneViewer() in an attempt to keep the workflow within one RStudio window/context.
  • change height to 97% to fill viewer
  • document more thoroughly
  • pass trial CRAN check

Bug Fixes

  • fix internal combine_list_of_sf with length 0 list; found when editFeatures() and save with no changes

mapedit 0.2.0

  • add Shiny module functionality
  • add selectFeatures function for easy selection of features from simple features (sf)
  • defaults to repeat mode in editMap()
  • removes circle Leaflet.draw tool by default in editMap()
  • use layerId instead of group for select
  • uses Viewer window for selectMap()
  • promote mapview to Imports
  • uses newly exported mapview::addFeatures()

mapedit 0.1.0

API breaking change

  • camelCase editMap and selectMap

mapedit 0.0.2

  • add dependency on dplyr
  • add dependency on sf
  • edit_map() now returns sf instead of geojson by default. Toggle behavior with the sf argument.

mapedit 0.0.1

  • first release with proof-of-concept functionality

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("mapedit")

0.3.2 by Tim Appelhans, 7 months ago


https://github.com/r-spatial/mapedit


Report a bug at https://github.com/r-spatial/mapedit/issues


Browse source code at https://github.com/cran/mapedit


Authors: Tim Appelhans [aut, cre], Kenton Russell [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dplyr, htmltools, htmlwidgets, jsonlite, leaflet, leaflet.extras, mapview, miniUI, sf, shiny

Enhances geojsonio


Imported by MODIS, lidR.


See at CRAN