r-mapview

filtering data reactively to generate maps

纵然是瞬间 提交于 2021-01-28 11:01:57
问题 In working with a map in shiny using mapview , I've been flummoxed by reactives and trying to make my map dynamically update. Here is a reproducible example that doesn't work properly, despite being designed using principles from other SO answers: # # This is a Shiny web application. You can run the application by clicking # the 'Run App' button above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) library(sf) library(mapview) #

How to set an uneven sequence for legends in mapview?

我的梦境 提交于 2020-02-07 02:37:07
问题 The following code creates a legend with even breaks. How could I change it so that every value from 0-1 is shown as white, and values from 1-max value are shown with breaks of 0.5 displayed with graduated shades? (In other words, the only change to the map below would be that all values 0-1 are shown in white). Mapview doesn't seem to recognize breaks . The only other solution I can think of is to split the data and make two maps, one of SHAPE_LEN values from 0-1, and the second of SHAPE_LEN

display of mapview object in shiny

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 07:19:11
问题 I’m trying to have two spatial plots side-by-side in shiny, and I was suggested a powerful function, sync of mapview . sync allows to have multiple maps for comparison, a great feature, but unable to figure out integrating or calling its output in shiny. I have gone through ‘mapview for shiny’ and other related links mapview/shiny. The former suggested using renderMapview and mapviewOutput , however it did not work, i.e., no map being displayed. Please see the reproducible code. Also, I tried

Point color and symbol size based on different variables in mapview

跟風遠走 提交于 2019-12-24 00:03:06
问题 I'm trying for a divergent scale theme in mapview to help visualize gains vs. losses, with: point symbol circle sizes on an absolute value scale (to highlight losses as much as gains) a divergent color scale fill for the circles (say dark blue>blue>white>red>dark red for most negative>negative>zero>positive>largest) mouse over hover label of the original value retained any ideas? library(tidyverse) library(mapview) library(sf) lat <- rep(34,16) lon <- seq(-128, -126, length = 16) value <- c(

RGB colors in a raster cube visualization in R

萝らか妹 提交于 2019-12-13 04:25:51
问题 I am using the package mapview to plot a 3D raster cube from a raster stack . > S2_images class : RasterStack dimensions : 660, 1074, 708840, 6 (nrow, ncol, ncell, nlayers) resolution : 10, 10 (x, y) extent : 219800, 230540, 4097480, 4104080 (xmin, xmax, ymin, ymax) coord. ref. : +proj=utm +zone=30 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 names : L2A_T30ST//51_B02_10m, L2A_T30ST//51_B03_10m, L2A_T30ST//51_B04_10m, L2A_T30ST//51_B08_10m, L2A_T30ST//51_B11_20m, L2A_T30ST//51

Place non-geographic mapview object into Shiny app

空扰寡人 提交于 2019-12-08 11:52:06
问题 Basically my question is how to place either a PNG or a mapview object into a shiny app to enable placement of markers over it. I have 15 non-geographic floorplan mapview objects like PNG above that were converted to mapview objects using the code below with the assistance of another SO user question here: library(raster) library(png) library(mapview) ohs<-data.frame(OHS_no=c(1001:1010), x=runif(10, 0, 1), y = runif(10, 0, 0.8), AGE = c(4, 15, 15, 43, 5, 50, 67, 77, 77, 28)) web_img <- "http:

Synchronizing two leaflet maps in R / Rmarkdown

北城以北 提交于 2019-12-05 02:11:27
问题 JS leaflet allows two maps to be synchronized. See an example of synchronized leaflet maps here. I would like to implement synchronized leaflet maps in R and more specifially in Rmarkdown/knitr . Preferably, the maps should shown next to each other horizontally (just like in the example). Here is a minimal Rmarkdown ( .Rmd ) example of two maps I would like to sync. The solution does not have to be based on the the mapview package. Any solution is welcome really (-: --- title: "How to sync 2

Synchronizing two leaflet maps in R / Rmarkdown

旧巷老猫 提交于 2019-12-03 18:55:39
JS leaflet allows two maps to be synchronized . See an example of synchronized leaflet maps here . I would like to implement synchronized leaflet maps in R and more specifially in Rmarkdown/knitr . Preferably, the maps should shown next to each other horizontally (just like in the example ). Here is a minimal Rmarkdown ( .Rmd ) example of two maps I would like to sync. The solution does not have to be based on the the mapview package. Any solution is welcome really (-: --- title: "How to sync 2 leaflet maps" author: "me" date: "2 April 2016" output: html_document --- ```{r SETUP, include=FALSE

mapview for shiny

这一生的挚爱 提交于 2019-11-30 11:46:58
I create an interactive map using mapView the mapview() function works fine with my gridded data ( SpatialPixelsDataFrame ): Code: library(sp) library(ggplot2) library(gstat) library(rgdal) library(mapview) library(RMySQL) con <- dbConnect(MySQL(), user="root", password="", host="127.0.0.1", dbname="rstudio") data<-dbReadTable(con,"data") on.exit(dbDisconnect(con)) data_test <- data data_test$x <- data$long data_test$y <- data$lat coordinates(data_test) = ~x + y x.range <- as.numeric(c(-5.99, -5.74)) y.range <- as.numeric(c(35.57, 35.81)) grd <- expand.grid(x = seq(from = x.range[1], to = x