PWFSLSmoke (version 1.2.100)

staticmap_getEsrimapBrick: Create a rasterBrick from an Esri tiled image server

Description

Uses the input coordinates to fetch and composite a raster from the tile server. Returns a raster::rasterBrick object. This can then passed as the rasterBrick object to the staticmap_plotRasterBrick() function for plotting.

As of July 2019, this list is a handy reference to the freely available tile servers which can be previewed at the following URL:

https://leaflet-extras.github.io/leaflet-providers/preview/

Usage

staticmap_getEsrimapBrick(centerLon = NULL, centerLat = NULL,
  maptype = "world_topo", zoom = 12, width = 640, height = 640,
  bbox = NULL, maxTiles = 20, crs = sp::CRS("+init=epsg:4326"),
  tileCacheDir = tempdir())

Arguments

centerLon

Map center longitude.

centerLat

Map center latitude.

maptype

Selects the appropriate Esri tile server. Options include:

  • "world_topo"

  • "world_imagery"

  • "world_terrain"

  • "de_Lorme"

  • "world_grey"

  • "world_streets"

zoom

map Zoom level.

width

Width of image, in pixels.

height

Height of image, in pixels.

bbox

Bounding box vector (lonLo, latLo, lonHi, latHi). If not null, centerLon, centerLat, and zoom are ignored.

maxTiles

Maximum number of tiles to be returned. The greater the number, the slower the performance -- arbitrarily set to 20 by default.

crs

Object of class CRS. The Coordinate Reference System (CRS) for the returned map. If the CRS of the downloaded map does not match, it will be projected to the specified CRS using raster::projectRaster.

tileCacheDir

Optional location for cached tiles.

Value

A rasterBrick object which can be plotted with staticmap_plotRasterBrick() or raster::plotRGB() and serve as a base plot.

See Also

staticmap_getRasterBrick

staticmap_plotRasterBrick

Examples

Run this code
# NOT RUN {
rasterBrick <- staticmap_getEsrimapBrick(-122.3318, 47.668)
staticmap_plotRasterBrick(rasterBrick)
# }

Run the code above in your browser using DataLab