If you are not redirected automatically, follow the link to new page mapview - interactive viewing of spatial data in R


(CC-BY-SA)

This document was produced on So 19 Mär 2017 using mapview version 1.2.49


This online documentation to mapview provides the following chapters:

  1. mapview basics
  2. advanced controls
  3. options
  4. popups
  5. sync & latticeView
  6. viewRGB
  7. cubeView
  8. slideView

Introduction

mapview is an R package created to help researchers during their spatial data analysis workflow. It provides functions to very quickly and conveniently create interactive visualisations of spatial data.

mapview was created o fill the gap of quick (not presentation grade) interactive plotting to examine and visually investigate spatial data. So far, one had to either:

The main workhorse function is mapview() and is currently defined for:

mapview is in large parts based on RStudios leaflet package (think of it as a data-driven leaflet), though in order to aid general spatial analysis workflow, we have added a few special functions.


General design

A call to mapview() will return an object of class mapview. This class has 2 slots:

By default mapView() provides five base layers between which one can toggle (a preview of leaflet layers can be found here):

Whenever mapview detects that the colors to be rendered are too light (i.e. have a high mean luminence) the default map will be changed from CartoDB.Positron to CartoDB.DarkMatter.

Furthermore, mapview provides the following standard features:

Depending on the object and/or argument settings one or several layers are created (each with or without it’s own legend) that can also be toggled.

Note that in order to render properly, mapview will re-project data for you on the fly to ensure that it will be located correctly on the map which may take some time for larger data sets. If you want to make sure your data is projected so that mapview doesn’t need to re-project it for you, make sure that


Here’s what a basic call to mapview() will look like

library("mapview")
mapview(breweries)

For a more detailed introduction to the basic features of mapview see the next chapter on mapview basics

mapview also provides some advanced functionality tailored towards aiding spatial analysis beyond mapping. See the respective chapters for further details.

HAPPY MAPPING!