identifyDriver | R Documentation |
identifyDriver()
will try to identify the driver that can open the passed
file name by invoking the Identify method of each registered GDALDriver in
turn. The short name of the first driver that successfully identifies the
file name will be returned as a character string. If all drivers fail then
NULL
is returned.
Wrapper of GDALIdentifyDriverEx()
in the GDAL C API.
identifyDriver(
filename,
raster = TRUE,
vector = TRUE,
allowed_drivers = NULL,
file_list = NULL
)
filename |
Character string containing the name of the file to access. This may not refer to a physical file, but instead contain information for the driver on how to access a dataset (e.g., connection string, URL, etc.) |
raster |
Logical value indicating whether to include raster format
drivers in the search, |
vector |
Logical value indicating whether to include vector format
drivers in the search, |
allowed_drivers |
Optional character vector of driver short names
that must be considered. Set to |
file_list |
Optional character vector of filenames, including those
that are auxiliary to the main filename (see Note). May contain the input
|
A character string with the short name of the first driver that
successfully identifies the input file name, or NULL
on failure.
In order to reduce the need for such searches to touch the file system
machinery of the operating system, it is possible to give an optional list
of files. This is the list of all files at the same level in the file
system as the target file, including the target file. The filenames should
not include any path components. If the target object does not have
filesystem semantics then the file list should be NULL
.
At least one of the raster
or vector
arguments must be TRUE
.
gdal_formats()
src <- system.file("extdata/ynp_fires_1984_2022.gpkg", package="gdalraster")
identifyDriver(src) |> gdal_formats()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.