2

I've been trying to install support for ECW so I can load them in latest QGIS 3.6 (also tried in QGIS 3.4.4)

Having tried the following tutorials:

https://wiki.openstreetmap.org/wiki/ECW (gdal 2.2.3)

https://gist.github.com/1papaya/568c4580b1909071696c1cb119101823 (gdal 2.3.1)

Both appear to work and report back ECW support against gdal

gdalinfo --formats | grep ECW
ECW -raster- (rw): ERDAS Compressed Wavelets (SDK 3.x)
JP2ECW -raster,vector- (rw+v): ERDAS JPEG2000 (SDK 3.x)

However when opening QGIS I notice that key UI is missing - the little triangles next to all the processing toolbox processes are missing, and the whole of QGIS becomes unstable - for example it crashes to desktop when selecting plugins within the plugin manager.

enter image description here

I then have alot of trouble recovering QGIS to get the UI back - full removal and purge of all dependencies + QGIS reinstall does not restore it! have to carry out full ubuntu reinstall to get it all back, which is not ideal.

Is gdal completely independent per version install. as above tutorials focus on particular gdal download which you then appear to manipulate?

QGIS 3.6 appears to use gdal 2.2.3

QGIS 3.4.4 appears to use gdal 2.4.0

so far I've carried out above tutorials first then installed QGIS, should I perhaps install QGIS first then attempt to adjust the GDAL that QGIS installs as a dependency?

3

If you want to use a self-compiled GDAL with QGIS packages, you have to use exactly the same GDAL version that the packages are compiled against. For bionic (Ubuntu 18.04 and Linux Mint 19), You can find the version in https://qgis.org/ubuntu/dists/bionic/main/binary-amd64/Packages and https://qgis.org/ubuntugis/dists/bionic/main/binary-amd64/Packages if you search for the gdal-abi dependency.

Currently this is GDAL 2.2.3 in the main Ubuntu repo and 2.3.2 in the Ubuntugis-unstable ppa.

https://trac.osgeo.org/gdal/wiki/ECW suggests to use the ECW SDK v 5.4 with GDAL 2.2.4 or newer.

UPDATE FROM THE COMMENTS

It seems to be necessary to install the libpng-dev package before self-compiling GDAL.

Don't remove the packaged GDAL version, because this will remove QGIS and any other GDAL-dependant package too. Instead, copy the self-compiled libgdal files and the libNCSEcw files from /usr/local/lib to /usr/lib.

QGIS 2.18.28 from the ubuntugis unstable ppa (without using any qgis.org) installs fine along with the ECW driver, as well as QGIS 3.4 and QGIS 3.6 from https://qgis.org/ubuntugis-ltr bionic or https://qgis.org/ubuntugis bionic. It even works for GDAL 2.2.3 and Qgis 3.6 from https://qgis.org/ubuntu bionic without any ubuntugis dependency.

If you installed against ubuntugis-unstable, You have to update and recompile GDAL every time that ubuntugis-unstable updates GDAL. The GDAL version in the main ubuntu repo will not change, until you upgrade your OS to a newer version.

  • Thanks for looking into this AndreJ, I've just tested both of these in my sources.list qgis.org/ubuntugis-ltr bionic & qgis.org/ubuntugis bionic and get the following trying to install via this command sudo aptitude -f install qgis python-qgis qgis-plugin-grass The following packages have unmet dependencies: libqgis-analysis3.4.5 : Depends: gdal-abi-2-3-0 which is a virtual package and is not provided by any available package libqgis-app3.4.5 : Depends: libproj13 (>= 5.0.0) which is a.. Amongst a couple of others dependency issues. – Rossoe Feb 25 at 13:48
  • You should only select one of them, and add the ubuntugis-unstable ppa too, see launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-unstable . Then update and upgrade to get the latest updates. This should bring you GDAL 2.3.2 (without ECW). Check that you have the necessary keys for ubuntugis and QGIS, otherwise you can't update. After that, you can install qgis and python-qgis. – AndreJ Feb 25 at 16:38
  • indeed I was testing each deb independently, but only after adding the PPA you noted above did I get past the GDAL dependency errors. So I've now got QGIS 3.4.5 and GDAL 2.3.2 - would I now need to simply follow - gist.github.com/1papaya/568c4580b1909071696c1cb119101823 to rebuild GDAL? – Rossoe Feb 25 at 21:23
  • Yes, but don't remove the GDAL package, it would remove QGIS too. Instead, just recompile, and copy the files from /usr/local/lib to /usr/lib. And take GDAL 2.3.2. – AndreJ Feb 26 at 7:02
  • ok so after following steps in the github tutorial, my folder /usr/local/lib contained 5 GDAL related files which I then copied to /usr/lib using sudo find -iname 'libgdal*' -exec cp {} /usr/lib/ \; it overwrote 2 existing GDAL files already within /usr/lib 'libgdal.so.20' & 'libgdal.so.20.4.2'. But starting up QGIS and I'm getting the exact same corruption as per my first post - very unstable broken UI, and crashing frequently. This was with QGIS 3.6 and GDAL 2.3.2. QGIS was fine just prior to the copying of files. Am I doing the copy incorrectly? – Rossoe Feb 26 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.