Retrieve currently visible map canvas content.

mapCanvas.saveAsImage(filename = tempfile(), format = "png", ...)

Arguments

filename

name of the file to be written to disk (if none is specified, the image is written to a temporary file).

format

the image format in which the canvas should be exported and transferred. While this is primarily relevant for how images are saved to disk, choice of a lossy format (such as jpg) can also affect the values of the RasterBrick returned by the function.

...

low-level parameters (such as host and auth) to be passed on to qgisremote()

Value

A RasterBrick object specifying the RGB values of the returned image, with the projection and extent set to that of the map canvas.

Details

Retrieves the map canvas in the given image format, saves it to disk at the given path, and returns the image data as a RasterBrick object.

See also

raster::plotRGB()

Examples

## imagedata <- mapCanvas.saveAsImage() ## raster::plotRGB(imagedata)