[GIS] How to get ECW support on QGIS 2.16 – Ubuntu 16.04

ecwgdalqgisUbuntu

after several attempts I am still not able to enable ECW support on QGIS on Ubuntu Xenial.

Before updating to latest version of Ubuntu, solution proposed here worked for me on the same machine, but now it fails to complete the

gdal-ecw-build

command.

I tried several version of ecw sdk, but it always ends with a series of errors, where the last one is:

make: *** [ecwdataset.o] Errore 1

I also tried to change the gdal-ecw-build script adding a flag as suggested here, but without any effects.

Some info about my setup:

  • GCC version: 5.4
  • GDAL version: 2.1
  • QGIS version: 2.16.2

Best Answer

As I noted in the updated answer to the linked question, there is NO pre-packaged solution for newer versions of Ubuntu. The libgdal-ecw-src package had been developed for GDAL 1.10, and will not work out-of-the-box with newer GDAL versions, and you will get no GDAL 1.10 for newer Ubuntu versions.

Unless you are able to review the code (supposed you know exactly what it is doing), the only workaround is installing a virtual box with Ubuntu precise (12.04) and GDAL 1.10 just for converting ecw files.

A better way is to self-compile GDAL with ECW support, as described in https://gist.github.com/1papaya/568c4580b1909071696c1cb119101823 and Can't install support for ECW in QGIS 3.6 / 3.4 on Ubuntu 18.04

Or put Windows in a virtual box, if you have a license for that.