linkGDAL: Locate and set up 'GDAL' API bindings

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/linkGDAL.R

Description

Locate and set up 'GDAL - Geospatial Data Abstraction Librar' API bindings

Usage

1
2
3
4
5
6
7
linkGDAL(
  bin_GDAL = NULL,
  searchLocation = NULL,
  ver_select = FALSE,
  quiet = TRUE,
  returnPaths = TRUE
)

Arguments

bin_GDAL

string contains path to where the gdal binaries are located

searchLocation

string hard drive letter default is C:

ver_select

boolean default is FALSE. If there is more than one 'GDAL' installation and ver_select = TRUE the user can select interactively the preferred 'GDAL' version

quiet

boolean switch for supressing messages default is TRUE

returnPaths

boolean if set to FALSE the pathes of the selected version are written to the PATH variable only, otherwise all paths and versions of the installed GRASS versions ae returned.

Details

It looks for the gdalinfo(.exe) file. If the file is found in a bin folder it is assumed to be a valid 'GDAL' binary installation.

if called without any parameter linkGDAL() it performs a full search over the hardrive C:. If it finds one or more 'GDAL' binaries it will take the first hit. You have to set ver_select = TRUE for an interactive selection of the preferred version.

Value

add gdal pathes to the enviroment and creates global variables path_GDAL

Note

You may also set the path manually. Using a 'OSGeo4W64' https://trac.osgeo.org/osgeo4w/ installation it is typically C:/OSGeo4W64/bin/

Author(s)

Chris Reudenbach

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# call if you do not have any idea if and where GDAL is installed
gdal<-linkGDAL()
if (gdal$exist) {
# call it for a default OSGeo4W installation of the GDAL
print(gdal)
}

## End(Not run)

link2GI documentation built on Sept. 5, 2021, 5:34 p.m.