gdal | R Documentation |
functions to interact with gdal not meant to be called directly by users (but e.g. by stars::read_stars)
gdal_read( x, ..., options = character(0), driver = character(0), read_data = TRUE, NA_value = NA_real_, RasterIO_parameters = list() ) gdal_write( x, ..., file, driver = "GTiff", options = character(0), type = "Float32", NA_value = NA_real_, geotransform, update = FALSE ) gdal_inv_geotransform(gt) gdal_crs(file, options = character(0)) gdal_metadata( file, domain_item = character(0), options = character(0), parse = TRUE ) gdal_subdatasets(file, options = character(0), name = TRUE) gdal_polygonize( x, mask = NULL, file = tempfile(), driver = "GTiff", use_integer = TRUE, geotransform, breaks = classInt::classIntervals(na.omit(as.vector(x[[1]])))$brks, use_contours = FALSE, contour_lines = FALSE, connect8 = FALSE, ... ) gdal_rasterize(sf, x, gt, file, driver = "GTiff", options = character()) gdal_extract(f, pts, bilinear = FALSE) gdal_read_mdim(file, array_name = character(0), options = character(0)) gdal_write_mdim(x, file, dimension_values, units) gdal_create(f, nxy, values, crs, xlim, ylim)
x |
character vector, possibly of length larger than 1 when more than one raster is read |
... |
ignored |
options |
open options |
driver |
character; when empty vector, driver is auto-detected. |
read_data |
logical; if |
NA_value |
(double) non-NA value to use for missing values; if |
RasterIO_parameters |
list with named parameters to GDAL's RasterIO; see the stars::read_stars documentation. |
file |
file name |
type |
gdal write type |
geotransform |
length 6 numeric vector with GDAL geotransform parameters. |
update |
logical; |
gt |
double vector of length 6 |
domain_item |
character vector of length 0, 1 (with domain), or 2 (with domain and item); use |
parse |
logical; should metadata be parsed into a named list ( |
name |
logical; retrieve name of subdataset? If |
mask |
stars object with NA mask (0 where NA), or NULL |
use_integer |
boolean; if |
breaks |
numeric vector with break values for contour polygons (or lines) |
use_contours |
logical; |
contour_lines |
logical; |
connect8 |
logical; if |
sf |
object of class |
f |
character; file name |
pts |
points matrix |
bilinear |
logical; use bilinear interpolation, rather than nearest neighbor? |
array_name |
array name |
dimension_values |
list with dimension values |
units |
character; units names (udunits conform) corresponding to dimension_values |
nxy |
integer vector of length 2 |
values |
fill value |
crs |
object of class |
xlim |
numeric |
ylim |
numeric |
These functions are exported for the single purpose of being used by package stars, they are not meant to be used directly and may change or disappear without prior notice or deprecation warnings.
gdal_inv_geotransform returns the inverse geotransform
gdal_crs reads coordinate reference system from GDAL data set
get_metadata gets metadata of a raster layer
gdal_subdatasets returns the subdatasets of a gdal dataset
object of class crs
, see st_crs.
named list with metadata items
gdal_subdatasets
returns a zero-length list if file
does not have subdatasets, and else a named list with subdatasets.
## Not run: f = system.file("tif/L7_ETMs.tif", package="stars") f = system.file("nc/avhrr-only-v2.19810901.nc", package = "stars") gdal_metadata(f) gdal_metadata(f, NA_character_) try(gdal_metadata(f, "wrongDomain")) gdal_metadata(f, c("", "AREA_OR_POINT")) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.