Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

R interactive map in Power BI using raster and shapefile

Hello!
I'm trying to load my script in power BI, which is:

-----------
library(ggplot2)
library(ggmap)
library(plotly)
library(raster)
library(sf)
library(rgdal)
library(rgeos)
library(mapview)


setwd("C:/Users/Daniel/Desktop/IDGeo/Earth analytics course_Learn data science/data/week 4")

ndwi <- raster("california/SJER/vector_data/2017_06_04_NDWI_CLIP.tif")

pivos <- readOGR(dsn = "california/SJER/vector_data",
"aneis_anapaula_0904")


M2<- mapView(ndwi, alpha.regions = 0.50, na.color = "transparent")
m4 <- mapview(pivos, lwd = 1.5, color = "gray40")

M2 + m4

 

-------------
ndwi = my raster data
pivos = my shapefile

----

In R it works perfectly and returns an interactive map containing my raster data plus myshapefile, however, in pwrbi nothing happen...

Anyone knows what could be happening?
Or, anyone could suggest another way to plot raster + shapefile interactive maps in power BI using R?
Thanks very much, best regards.

No Replies