gdalUtils (version 2.0.3.2)

gdal_chooseInstallation: gdal_chooseInstallation

Description

Choose a GDAL installation based on certain requirements.

Usage

gdal_chooseInstallation(hasDrivers)

Arguments

hasDrivers

Character. Which drivers must be available?

Value

Numeric id of the most recent installation that matches the requirements.

Details

By default, the GDAL commands will use the installation found at getOption("gdalUtils_gdalPath")[[1]], which is the most recent version found on the system. If the user has more than one GDAL installed (more common on Windows and Mac systems than *nix systems), gdal_chooseInstallation can be used to choose an installation (perhaps not the most recent one) that has certain functionality, e.g. supports HDF4 formatted files.

References

http://www.gdal.org/gdal_translate.html

Examples

Run this code
# NOT RUN {
# Choose the best installation that has both HDF4 and HDF5 drivers:
gdal_chooseInstallation(hasDrivers=c("HDF4","HDF5"))
# Get the version of this installation:
getOption("gdalUtils_gdalPath")[[
	gdal_chooseInstallation(hasDrivers=c("HDF4","HDF5"))]]$version
# }

Run the code above in your browser using DataCamp Workspace