slippyRaster: Raster Layer Slippy Map Generation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/slippyRaster.r

Description

Generates tiles and a tile-based slippy map based on the Leaflet Javascript library, from a Raster class object.

Usage

1
slippyRaster(rst, zoom = c(3, 9), output, col = rev(terrain.colors(255)), browse = TRUE)

Arguments

rst

The Raster dataset - should be in WGS84 projection.

zoom

A vector containing the minimum and maximum zoom levels (1-16).

output

Location for tile output.

col

Colour palette definition for object. By default, the same as for standard plot.raster output.

browse

Launch a browser to display the map when complete.

Details

Currently renders a raster to tiles, produces the HTML/Javascript code to display it. No projection of raster into the correct coordinate system currently takes place, so geographic WGS84 rasters are required. Note that there is a web Mercator error at small scales that I'm working on fixing.

Value

Launches a browser window displaying the map, and returns the location of the index.html file.

Author(s)

Grant Williamson

See Also

slippySpatial

Examples

1
2
3
4
5
6
7
8
9
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
library(raster)
rst=raster("ann_npp.tif")
output="tilemap"
render_tiles(rst,c(3,9),output,browse=TRUE)

ozjimbob/Rslippy documentation built on May 24, 2019, 5:56 p.m.