Skip to main content

Questions tagged [r-mapedit]

An R package that provides methods for interactive editing of spatial objects from the sf, sp and raster packages.

0 votes
0 answers
48 views

Polygon duplicated when using 'Cut layers'

I'm building a Shiny app using leafpm polygon editor. Basically I apply some changes to an existing polygon, then I save the edited polygons and edit the leaflet map by removing polygons and adding ...
Victor Cz's user avatar
0 votes
1 answer
66 views

Load shapefile in R Shiny mapedit editMod

In a Shiny app I use polygons that can be drawn manually with editMod() or loaded from shapefiles. It works for the calculation but so far the loaded shapefiles are not mapped on the editMod leaflet. ...
Victor Cz's user avatar
0 votes
1 answer
55 views

Reset editMod mapedit in R Shiny

I'm creating a R Shiny app using the drawing tools of mapedit through editMod() to run some operations (in the reprex below I simplified to just calculating the area of the drawn polygons). I have ...
Victor Cz's user avatar
0 votes
1 answer
84 views

Dynamically hide module from package in Shiny app

I try to build an application that dynamically shows and hides modules. Following this tutorial and this code, I can show and remove modules built by my own. However, when calling a module from an ...
r2d2's user avatar
  • 5
0 votes
0 answers
146 views

edit geometry attribute with mapedit in R

I aim to draw simple rectangle on a leaflet map in R using the mapview and mapedit package. However, does someone has an idea how to directly add a specific numeric value to each geometry just after ...
r2d2's user avatar
  • 5
1 vote
0 answers
88 views

Change color of leafpm-layer

Can I change the default color of an object added to a leaflet map by the leafpm-package? The default color is blue, which I would like to have in red. I managed to get the lines red (see below) until ...
Beni's user avatar
  • 251
3 votes
0 answers
113 views

replicate the behavior of mapedit::selectFeatures(..., mode = "click") within a Shiny app

I am trying to replicate the behavior of mapedit::selectFeatures(..., mode = "click") within a Shiny app. I have a working example similar to the solution posed here: Multi-Point Select in R/...
Jeremy Holden's user avatar
1 vote
1 answer
2k views

Read in a list of shapefiles and row bind them in R (preferably using tidy syntax and sf)

I have a directory with a bunch of shapefiles for 50 cities (and will accumulate more). They are divided into three groups: cities' political boundaries (CityA_CD.shp, CityB_CD.shp, etc.), ...
Abe's user avatar
  • 413
0 votes
2 answers
275 views

Shiny workaround to flush data from $finished while using EditMod in the mapEdit package

This is a crosspost from the mapedit issues github page here. I am attempting to build a shiny app that allows a user to plot a subset of data after selecting polygons using the mapedit package. While ...
mowen's user avatar
  • 1
0 votes
0 answers
206 views

R: Error when using viewRGB() and editMap()

Below is the code I am using: if (interactive()) { library(raster) library(plainview) viewRGB(plainview::poppendorf, 4, 3, 2) # true-color viewRGB(plainview::poppendorf, 5, 4, 3) # false-...
B.B.Zhou's user avatar
0 votes
1 answer
2k views

Converting a data frame to a spatial object

I'm trying to publish a map on Shiny, but keep running into this issue. Let's call the data.frame region. Here are the columns: library(mapedit) library(mapview) library(shiny) library(...
user avatar
1 vote
1 answer
650 views

Interactive Chloropeth Electoral College Map in R

I am looking to replicate one of those maps where you can guesstimate the state-level results of the next presidential election and have the results of your scenario shown to you by way of changing ...
tifu's user avatar
  • 1,401
8 votes
1 answer
3k views

How to update the leaflet map in the selectModUI in a Shiny app?

I would like to update the selectModUI from the mapedit package for different leaflet maps when using Shiny. Below is a working example. library(tidyverse) library(shiny) library(sf) library(leaflet) ...
www's user avatar
  • 39k
1 vote
1 answer
3k views

Convert XY to lat long in R

I am trying to plot the position of ports on a leaflet map which fall into a certain region. These 30 odd regions have been created using the mapedit package as sf POLYGONs. The code for one such ...
Dhiraj's user avatar
  • 1,700
0 votes
1 answer
90 views

Why do I get an error when using mapedit::selectFeatures with mode = 'draw'?

I'm using the selectFeatures function within the R package called mapedit. I want to be able to select all polygons that fall within (either wholly or partially) an area drawn using the tools in the ...
Jody Biggs's user avatar