Learn R Programming

PWFSLSmoke (version 1.2.2)

esriMap_getMap: Download a Spatial Raster Object from ESRI

Description

Downloads a PNG from ESRI and creates a raster::rasterBrick object with layers for red, green, and blue. This can then passed as the mapRaster object to the esriMap_plotOnStaticMap() function for plotting.

Available maptypes include:

  • natGeo

  • worldStreetMap

  • worldTopoMap

  • satellite

  • deLorme

Additional base maps are found at: http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Basemaps/02r3000001mt000000/

Usage

esriMap_getMap(centerLon = NULL, centerLat = NULL, bboxString = NULL,
  bboxSR = "4326", maptype = "worldStreetMap", zoom = 12,
  width = 640, height = 640, crs = sp::CRS("+init=epsg:4326"),
  additionalArgs = NULL)

Arguments

centerLon

map center longitude

centerLat

map center latitude

bboxString

comma separated string with bounding box (xmin, ymin, xmax, ymax). If not null, centerLon, centerLat, and zoom are ignored.

bboxSR

spatial reference of the bounding box

maptype

map type

zoom

map zoom level; corresponds to googleMaps zoom level

width

width of image, in pixels

height

height of image, in pixels

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.

additionalArgs

character string with additional arguments to be pasted into the image URL eg. "&rotation=90"

Value

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

References

http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/

See Also

esriMap_plotOnStaticMap

Examples

Run this code
# NOT RUN {
map <- esriMap_getMap(-122.3318, 47.668)
esriMap_plotOnStaticMap(map)
# }

Run the code above in your browser using DataLab