gdal_can_open: Check whether GDAL can open a raster file

View source: R/RcppExports.R

gdal_can_openR Documentation

Check whether GDAL can open a raster file

Description

A lightweight diagnostic that tries to open the specified path via GDAL and returns TRUE if successful, FALSE if GDAL cannot open it. Stops with an informative error if the package was built without GDAL support.

Usage

gdal_can_open(path)

Arguments

path

Character string: path to the raster file.

Value

Logical TRUE if GDAL can open the file, FALSE otherwise.

Examples


if (has_gdal()) {
  gdal_can_open(system.file("extdata", "tiny.tif", package = "xbioclim"))
}


xbioclim documentation built on Oct. 5, 2026, 5:08 p.m.