I have several issues with terra and it's connection to GDAL. I installed terra v. 1.6.7 in R v. 4.2.1 on a Mac running Big Sur v. 11.6.8
I installed GDAL 3.2.2 from www.kyngchaos.com, located in HD/Library/Frameworks/GDAL.Framework
Issue 1: terra reports wrong GDAL version
gdal()
#[1] "3.4.2"
There is no GDAL 3.4.2 on my system (afaik).
Relatedly, gdal(lib = "proj")
gives "8.2.1"
but I have PROJ 7.2.1 installed.
Issue 2: terra cannot read NetCDF files
r1 <- rast("~/Downloads/soiltemp1.nc")
#Error: [rast] cannot read from /Users/db/Downloads/soiltemp1.nc
#Warning message:
#'/Users/db/Downloads/soiltemp1.nc' not recognized as a supported file format. (GDAL error 4)
whereas in terminal gdalinfo ~/Downloads/soiltemp1.nc
gives correct information on file contents.
Issue 3: terra does not list NetCDF drivers in GDAL
In R
gdal(drivers = TRUE)
the resulting report does not include NetCDF drivers
Issue 4: Cannot install terra from Github
remotes::install_github("rspatial/terra")
exits with error configure: error: proj_api.h not found in standard or given locations.
whereas proj_api.h is present in HD/Library/Frameworks/PROJ.framework/Headers/
Issue 5: sf also finds wrong Framework versions
Relatedly, library(sf)
reports Linking to GEOS 3.10.2, GDAL 3.4.2, PROJ 8.2.1; sf_use_s2() is TRUE
Any clues as to what is going on, much appreciated!