[R-sig-Geo] mapView: basic interactive viewing of spatial data in R

ping yang pingyang.whu at gmail.com
Fri Jul 24 15:54:20 CEST 2015

Hi Tim,

I installed the packages with the hints (with devtools and leaflet library)
successfully, however, when I tried to run the code from
I got issues:
First, the error came for
 meuse_rst <- stack(meuse.grid)
Error in nlayers(b) :
  error in evaluating the argument 'x' in selecting a method for function
'nlayers': Error in .newCRS(value) :
  4 arguments passed to .Internal(nchar) which requires 3

And I tried the the code with spatialPolygons:
m <- mapView(gadm, burst = FALSE)

However, the map did not show up instead created a pdf file (with a link
inside), I need to copy this link into browser for viewing the map.

Any ideas?



On Fri, Jul 24, 2015 at 4:39 AM, Tim Appelhans <tim.appelhans at gmail.com>

> Dear list members,
> I would like to draw your attention to a little 'project' I've been
> working on over the past few weeks.
> Using leaflet for R, I have defined some methods for spatial data (e.g.
> Raster*, Spatial* objects) to quickly visualise them in either the
> RStudio Viewer pan or the default web browser. The function I created
> for this is called mapView().
> Think of it as an interactive version of spplot()/plot() for spatial
> data (though less versatile). It enables zooming, paning and basic layer
> queries (i.e. printing of the attributes in the @data slot of Spatial*
> objects + the x/y location of the feature). For Raster* objects queries
> are currently not available as leaflet translates the data into RGB
> values for display. Furthermore, background maps can be defined and
> multiple different spatial object layers can be overlaid.
> At the moment mapView() lives in our Rsenal package on github
> (https://github.com/environmentalinformatics-marburg/Rsenal) but this is
> likely going to change at some point in the not too distant future. This
> also depends on whether there is active interest in developping this
> sort of thing further to provide more than the current admittedly rather
> limited functionality. This, however, would involve JavaScript coding
> which I do not have any experience with.
> A quick (non-interactive) intorduction can be found here:
> https://metvurst.wordpress.com/
> The full introductory article including interactive examples is
> published here:
> http://environmentalinformatics-marburg.github.io/web-presentations/20150723_mapView.html
> I hope this may prove useful for some of you.
> Also, if anyone is keen to get involved in taking this further, please
> let me know and we will see how to best proceed.
> Best,
> Tim
> --
> #####################################
> Tim Appelhans
> Department of Geography
> Environmental Informatics
> Philipps Universität Marburg
> Deutschhausstraße 12
> 35032 Marburg (Paketpost: 35037 Marburg)
> Germany
> Tel +49 (0) 6421 28-25957
> http://environmentalinformatics-marburg.de/
>         [[alternative HTML version deleted]]
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

	[[alternative HTML version deleted]]

More information about the R-sig-Geo mailing list