Description Usage Arguments Details Examples
Plot a matrix directly read via GDAL to match the current device size.
1 | plot_raster(filename, add = FALSE, ext = NULL, cols = NULL)
|
filename |
source |
add |
add to the plot |
The data is read in at the resolution required by the current device, assuming it's a single panel. TODO: read off the space to plot into from the device, and read only that window from the source at the right resolution.
1 2 3 4 5 6 7 8 9 10 11 12 | ## this file takes 5s to read in total from NetCDF, 24 seconds via GDAL
filename <- "/rdsi/PRIVATE/raad/data_local/www.bodc.ac.uk/gebco/GRIDONE_2D.nc"
#filename <- raadtools::topofile()
#filename <- "D:/data/topography/etopo2/subset.tif"
library(vapour)
## read in to match the device and it's quicker
plot_raster(filename)
#zoom(wrld_simpl, new = FALSE)
#plot_raster(filename, ext = spex::spex(), add = T, col = rainbow(100))
#maps::map(add = TRUE)
## library(sf); plot(st_transform(sst_c, 4326), add = T)
##for (i in sample(seq_len(nrow(wrld_simpl)))) {plot_raster(filename, ext = raster::extent(wrld_simpl[i, ])); plot(wrld_simpl[i, ], add = TRUE)}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.