| gdalio_data | R Documentation |
Data may be one band (the default, first band) or many.
gdalio_graphics(dsn, bands = 1:3, ...) gdalio_matrix(dsn, ...) gdalio_array(dsn, ...) gdalio_image(dsn, ..., extent = NULL, dimension = NULL, projection = NULL) gdalio_data(dsn, ..., bands = 1L) gdalio_graphics(dsn, bands = 1:3, ...) gdalio_matrix(dsn, ...) gdalio_array(dsn, ...)
dsn |
character string, raster source understood by GDAL |
bands |
default 1L, but can be more, duplicated in different order, or 'NULL' for all |
... |
arguments passed to 'vapour::vapour_warp_raster' |
gdalio_data() returns a list of vectors, gdalio_matrix() and gdalio_array() and
gdalio_graphics() return
a matrix, array, matrix of the necessary shape, as used by image() and plot().
The matrix of hex values returned by gdalio_graphics() cannot really be placed on a spatial
plot window without a lot of extra work, but it's good for fast visuals to 'plot()' the output.
We can write helpers to plot this thing better but WIP atm.
list of numeric vectors
## Not run:
f <- system.file("extdata/sst.tif", package = "vapour", mustWork = TRUE)
g <- list(extent = c(130, 160, -60, -30), dimension = c(180, 100),
projection = "+proj=longlat")
gdalio_set_default_grid(g)
v <- gdalio_data(f, band_output_type = "int")
image(seq(130, 160, length.out = 181), seq(-60, -30, length.out = 101),
matrix(v[[1]], g$dimension[1])[,g$dimension[2]:1], asp = 1.5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.