slippy_raster: Creates a square raster centred on any lat long point, or a...

Description Usage Arguments Value Examples

View source: R/slippy_raster.R

Description

Creates a square raster centred on any lat long point, or a rectangular raster surrounding a set of lat long points from 'Mapbox', 'Mapzen' or 'Stamen' Maps using the 'slippymath' package

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
slippy_raster(
  lat,
  long,
  square_km,
  width_buffer = 1,
  image_source = "stamen",
  image_type = "watercolor",
  max_tiles = 10,
  api_key
)

Arguments

lat

WGS84 latitude. Either a single point to use as the centre for a square_km sized raster, or a vector of track points

long

WGS84 longitude. Either a single point to use as the centre for a square_km sized raster, or a vector of track points

square_km

length of one edge the required square area, in km. Ignored if lat and long have length > 1

width_buffer

If lat and long have length > 1, used as buffer distance around the provided points in km

image_source

Source for the overlay image. Valid entries are "mapbox", "mapzen", "stamen".

image_type

The type of overlay to request. "satellite", "mapbox-streets-v8", "mapbox-terrain-v2", "mapbox-traffic-v1", "terrain-rgb", "mapbox-incidents-v1" (mapbox), "dem" (mapzen) or "watercolor", "toner", "terrain" (stamen)

max_tiles

Maximum number of tiles to be requested by 'slippymath'

api_key

API key (required for 'mapbox')

Value

a rasterBrick image

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
lat <- 54.4502651
long <- -3.1767946
square_km <- 1

overlay_image <- slippy_raster(lat = lat,
  long = long,
  square_km = square_km,
  image_source = "stamen",
  image_type = "watercolor",
  max_tiles = 5)

neilcharles/geoviz documentation built on May 6, 2020, 9:06 p.m.