sf (version 0.6-3)

gdal: functions to interact with gdal not meant to be called directly by users (but e.g. by stars::st_stars)

Description

functions to interact with gdal not meant to be called directly by users (but e.g. by stars::st_stars)

Usage

gdal_read(x, ..., options = character(0), driver = character(0),
  read_data = TRUE, NA_value = NA_real_)

gdal_write(x, ..., file, driver = "GTiff", options = character(0), type = "Float32", NA_value = NA_real_)

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)

Arguments

x

character vector, possibly of length larger than 1 when more than one raster is read

...

ignored

options

character; raster layer read options

driver

character; when empty vector, driver is auto-detected.

read_data

logical; if FALSE, only the imagery metadata is returned

NA_value

(double) non-NA value to use for missing values; if NA, when writing missing values are not specially flagged in output dataset, when reading the default (dataset) missing values are used (if present / set).

file

character; file name

type

gdal write type

gt

double vector of length 6

domain_item

character vector of length 0, 1 (with domain), or 2 (with domain and item); use "" for the default domain, use NA_character_ to query the domain names.

parse

logical; should metadata be parsed into a named list (TRUE) or returned as character data?

name

logical; retrieve name of subdataset? If FALSE, retrieve description

Value

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.

Details

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

Examples

Run this code
# 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"))
# }

Run the code above in your browser using DataCamp Workspace