# OTB installation causes conflict with QGIS and R (ubuntu 20.1)

**URL:** <https://forum.orfeo-toolbox.org/t/otb-installation-causes-conflict-with-qgis-and-r-ubuntu-20-1/1087>\
**Category:** OTB Usage\
**Created:** [June 11, 2021, 7:29am UTC](https://forum.orfeo-toolbox.org/t/otb-installation-causes-conflict-with-qgis-and-r-ubuntu-20-1/1087 "2021-06-11T07:29:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alobo](https://forum.orfeo-toolbox.org/user_avatar/forum.orfeo-toolbox.org/alobo/32/132_2.png) [@alobo](https://forum.orfeo-toolbox.org/u/alobo)\
**Post date:** [June 11, 2021, 7:29am UTC](https://forum.orfeo-toolbox.org/t/otb-installation-causes-conflict-with-qgis-and-r-ubuntu-20-1/1087/1 "2021-06-11T07:29:41Z")

</div>

The standard OTB installation  
[https://www.orfeo-toolbox.org/CookBook/Installation.html](https://www.orfeo-toolbox.org/CookBook/Installation.html)

causes a conflict of proj for QGIS and R:

> <https://github.com/qgis/QGIS/issues/43680>
>
> As soon as I do not use EPSG:4326, I get:
> 
> No transform is available between U…TM Zone 31, Northern Hemisphere and EPSG:25831 - ETRS89 / UTM zone 31N.
> proj\_create\_operations: cannot build geodeticCRS 4326: SQLite error on SELECT name, ellipsoid\_auth\_name, ellipsoid\_code, prime\_meridian\_auth\_name, prime\_meridian\_code, area\_of\_use\_auth\_name, area\_of\_use\_code, publication\_date, deprecated FROM geodetic\_datum WHERE auth\_name = ? AND code = ?: no such column: publication\_date
> 
> qgis info: https://www.dropbox.com/s/8g03klgzr2bj069/Screenshot%20from%202021-06-10%2018-35-35.png?dl=0

> <https://github.com/rspatial/terra/issues/248>
>
> I have the following problem at installing terra (Pop!\_OS 20.10 based on ubuntu …20.10):
> (I have PROJ 7.1.0-1 and gdal 3.13)
> 
> checking GDAL: linking with --libs only... yes
> checking GDAL: /usr/share/gdal/pcs.csv readable... no
> checking GDAL: checking whether PROJ is available for linking:... yes
> checking GDAL: checking whether PROJ is available fur running:... ERROR 1: PROJ: proj\_create\_from\_database: cannot build geodeticCRS 4326: SQLite error on SELECT name, ellipsoid\_auth\_name, ellipsoid\_code, prime\_meridian\_auth\_name, prime\_meridian\_code, area\_of\_use\_auth\_name, area\_of\_use\_code, publication\_date, deprecated FROM geodetic\_datum WHERE auth\_name = ? AND code = ?: no such column: publication\_date
> ERROR 1: PROJ: proj\_create\_from\_database: cannot build projectedCRS 3857: cannot build geodeticCRS 4326: SQLite error on SELECT name, ellipsoid\_auth\_name, ellipsoid\_code, prime\_meridian\_auth\_name, prime\_meridian\_code, area\_of\_use\_auth\_name, area\_of\_use\_code, publication\_date, deprecated FROM geodetic\_datum WHERE auth\_name = ? AND code = ?: no such column: publication\_date
> ERROR 1: PROJ: proj\_create: unrecognized format / unknown name
> ERROR 6: Cannot find coordinate operations from \`' to \`'
> no
> configure: error: OGRCoordinateTransformation() does not return a coord.trans: PROJ not available?
> ERROR: configuration failed for package ‘terra’
> \* removing ‘/home/alobo/R/x86\_64-pc-linux-gnu-library/4.0/terra’
> Warning in install.packages :
> installation of package ‘terra’ had non-zero exit status
> 
> The downloaded source packages are in
> ‘/tmp/RtmpW6t4R0/downloaded\_packages’

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

instead of GDAL\_DATA and PROJ\_LIB

---

<div class="post-metadata">

**Author:** ![Cedric](https://forum.orfeo-toolbox.org/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@Cedric](https://forum.orfeo-toolbox.org/u/Cedric)\
**Post date:** [June 11, 2021, 8:20am UTC](https://forum.orfeo-toolbox.org/t/otb-installation-causes-conflict-with-qgis-and-r-ubuntu-20-1/1087/2 "2021-06-11T08:20:49Z")

</div>

Hello,

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

```bash
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`.

Can you try:

```auto
source otbenv.profile
export PROJ_LIB=/home/alobo/.local/share/proj:/usr/share/proj:/home/alobo/OTB/OTB-7.3.0-Linux64/share/proj
qgis

```

I think there is only a conflict in the proj data used by PROJ 7.1 and 7.2 here, not a conflict in the PROJ libraries.

Cédric

---

<div class="post-metadata">

**Author:** ![alobo](https://forum.orfeo-toolbox.org/user_avatar/forum.orfeo-toolbox.org/alobo/32/132_2.png) [@alobo](https://forum.orfeo-toolbox.org/u/alobo)\
**Post date:** [June 11, 2021, 9:25am UTC](https://forum.orfeo-toolbox.org/t/otb-installation-causes-conflict-with-qgis-and-r-ubuntu-20-1/1087/3 "2021-06-11T09:25:51Z")

</div>

All applications seem to work fine by modifying PROJ\_LIB in otbenv.profile as you indicate. I’ll report back in case of problems.  
Thanks
