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/
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)
map center longitude
map center latitude
comma separated string with bounding box (xmin, ymin, xmax, ymax). If not null, centerLon, centerLat, and zoom are ignored.
spatial reference of the bounding box
map type
map zoom level; corresponds to googleMaps zoom level
width of image, in pixels
height of image, in pixels
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
.
character string with additional arguments to be pasted into the image URL eg. "&rotation=90"
A rasterBrick object which can be plotted with esriMap_plotOnStaticMap()
or raster::plotRGB()
and serve as a base plot.
http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/
# NOT RUN {
map <- esriMap_getMap(-122.3318, 47.668)
esriMap_plotOnStaticMap(map)
# }
Run the code above in your browser using DataLab