| gdal_info | R Documentation |
Opens the raster at path and returns a named list with dimensions,
geotransform, coordinate reference system, and per-band scale/offset
values.
gdal_info(path)
path |
Character string: path to the raster file. |
Data values are always returned as double (float64) in
memory. If the raster bands carry GDAL scale/offset metadata (e.g. packed
integers), those are reported here and applied automatically by
GdalReader::read_window().
Stops with an informative error if the package was built without GDAL support.
Named list with the following elements:
pathCharacter: the path as supplied.
nrowsInteger: number of rows (Y pixels).
ncolsInteger: number of columns (X pixels).
nbandsInteger: number of raster bands.
geotransformNumeric vector of length 6 (GDAL
convention): [x_origin, pixel_width, rotation_x,
y_origin, rotation_y, pixel_height].
crsCharacter: WKT coordinate reference system string, or an empty string if not defined.
scaleNumeric vector (one per band): GDAL scale factor
(1.0 if not set).
offsetNumeric vector (one per band): GDAL offset
(0.0 if not set).
if (has_gdal()) {
info <- gdal_info(
system.file("extdata", "tiny.tif", package = "xbioclim")
)
str(info)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.