The conflict is caused by the OTB installation, which has its own proj (but 7.1 !)
/home/alobo/OTB/OTB-7.3.0-Linux64/bin/proj
I realized this fact thanks to rgdal, which reports:
Path to PROJ shared files: /home/alobo/OTB/OTB-7.3.0-Linux64/share/proj
If I remove the OTB installation and restart, the problems are solved both in QGIS and in R, and I can successfully
install terra, and sf. The rgdal installation, which always worked, reports another proj path:
Path to PROJ shared files: /home/alobo/.local/share/proj:/usr/share/proj
Unfortunately, If I install OTB even after having installed the R packages, I go back to problems in QGIS
and rgdal reports the OTB path for rproj again.
Is not there a way to get OTB use its own proj path but not setting a global proj path, so that other packages are not conflicted?
For example, using
#set GDAL_DATA variable used by otb application
OTB_GDAL_DATA=/home/alobo/OTB/OTB-7.3.0-Linux64/share/gdal
OTB_PROJ_LIB=/home/alobo/OTB/OTB-7.3.0-Linux64/share/proj
If I understand correctly, you have OTB installed in /home/alobo/OTB/OTB-7.3.0-Linux64/ (from binary packages I guess). What do you mean by install OTB ? sourcing otbenv.profile ? Something like
cd /home/alobo/OTB/OTB-7.3.0-Linux64/
source otbenv.profile
qgis # Cannot find proj paths
I think this has something to do with the PROJ_LIB variable set by otbenv.profile.