You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure I'm doing this correctly, but I would like to trace vectors on a raster using mapedit. I tried using raster and stars objects and they both produce different errors.
Here's a minimal reprex:
library(sf)
#> Linking to GEOS 3.8.0, GDAL 3.0.2, PROJ 6.2.1
library(mapview)
library(mapedit)
pol<-sf::st_as_sfc("POLYGON((0 0, 1.6 0, 1.6 1, 0 1, 0 0))", crs=4326)
rs<-stars::st_as_stars(pol)
r<-raster::raster(matrix(1:4, 2, 2), crs="+proj=longlat +datum=WGS84")
# editing on a polygon works fine
mapview(pol) %>%
editMap()
#> Loading required namespace: leaflet.extras#> #> Listening on http://127.0.0.1:6787
For vectors, it works well. Everything is there. There is a shiny error for stars objects:
@tim-salabim Have you tested mapview + stars with shiny? I see the addResourcePath error with any mapview + stars in shiny. Perhaps this is related to r-spatial/mapview#308.
I traced the error to this line in Shiny. The problem is that the path contains spaces. addResourcePathdocumentation says
#' @param prefix The URL prefix (without slashes). Valid characters are a-z,
#' A-Z, 0-9, hyphen, period, and underscore. For example, a value of 'foo'
#' means that any request paths that begin with '/foo' will be mapped to the
#' given directory.
I'm not sure I'm doing this correctly, but I would like to trace vectors on a raster using mapedit. I tried using raster and stars objects and they both produce different errors.
Here's a minimal reprex:
For vectors, it works well. Everything is there. There is a shiny error for stars objects:
With a raster object, there is no error, but the edit buttons are missing.
Session info
The text was updated successfully, but these errors were encountered: