Learn R Programming

⚠️There's a newer version (2.11.2) of this package.Take me there.

mapview

Interactive viewing of spatial data in R

mapview provides functions to very quickly and conveniently create interactive visualisations of spatial data. It was created to fill the gap of quick (not presentation grade) interactive plotting to examine and visually investigate both aspects of spatial data, the geometries and their attributes.

The main user relevant functions are:

  • mapview - view (multiple) spatial objects on a set of background maps
  • viewExtent - view extent / bounding box of spatial objects
  • viewRGB - view RGB true- or false-color images of raster objects
  • mapshot - easily save maps (including leaflet maps) as html and/or png (or other image formats)

Functions that have been deprecated/deleted recently:

  • addHomeButton - deprecated, use package leafem instead.
  • addLogo - deprecated, use package leafem instead.
  • addFeatures - deprecated, use package leafem instead.
  • addMouseCoordinates - deprecated, use package leafem instead.
  • addExtent - deprecated, use package leafem instead.
  • addImageQuery - deprecated, use package leafem instead.
  • latticeView & sync - deprecated, use package leafsync instead.
  • slideView - deprecated, use package slideview instead.
  • cubeView - deprecated, use package cubeview instead.
  • plainview - deprecated, use package plainview instead.
  • popupTable, popupGraph & popupImage - deprecated, use package leafpop instead.
  • addLargeFeatures - use leafgl::addGL* functions instead.

Objects of the following spatial classes are supported:

  • sf
  • raster (Layer, Stack, Brick and SpatialPixels* / SpatialGridDataFrame)
  • stars
  • sp (Points, Polygons, Lines and their DataFrame version)
  • satellite

Installation

For CRAN release version of mapview use

install.packages("mapview")

To install the development version install the devtools package.

devtools::install_github("r-spatial/mapview@develop")

Usage

The most basic call

mapview(breweries)

will produce a web map visualisation of the breweries data with the following components:

Contact

Please file bug reports and feature requests at https://github.com/r-spatial/mapview/issues

In case of Pull Requests, please make sure to submit them to the develop branch of this repository.

Copy Link

Version

Install

install.packages('mapview')

Monthly Downloads

18,074

Version

2.9.0

License

GPL (>= 3) | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

August 11th, 2020

Functions in mapview (2.9.0)

mapview-defunct

Defunct functions in mapview
franconia

Administrative district borders of Franconia
breweries

Selected breweries in Franconia
print,mapview-method

Method for printing mapview objects
mapviewColors

mapview version of leaflet::color* functions
mapviewOptions

Global options for the mapview package
mapshot

Save mapview or leaflet map as HTML and/or image
renderMapview

Render a mapview widget in shiny
viewRGB

Red-Green-Blue map view of a multi-layered Raster object
show,mapview-method

Method for printing mapview objects (show)
mapview-package

Interactive viewing of spatial objects in R
removeMapJunk

Delete elements from a map.
mapview-class

Class mapview
ops

mapview + mapview adds data from the second map to the first
mapView

View spatial objects interactively
npts

count the number of points/vertices/nodes of sf objects
knit_print.mapview

Print functions for mapview objects used in knitr
trails

Selected hiking trails in Franconia
viewExtent

View extent/bbox of spatial objects interactively
mapviewOutput

Create a mapview UI element for use with shiny
mapviewWatcher

Start and/or stop automagic mapviewing of spatial objects in your workspace.