2

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
2

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.

  • Thanks for the hint: I was finally able to convert my ecw files into geotiff using a docker instance of ubuntu 12.04. Not too easy to setup, but quicker than virtualbox, now that is running properly. – mmicotti Sep 15 '16 at 16:11
1

I have enabled ECW support on QGIS 2.18-ltr on Ubuntu Bionic and it works perfectly. You have to follow instruction from this link up to the command export LD_LIBRARY_PATH=/usr/local/lib not necessary. After installation of libecwj2-3.3-2006-09-06 and then of the gdal (same version of QGIS) own builted library, because of QGIS installs library in /usr/lib but your compiled library will be here /usr/local/lib, you have to do backup the n.3 files in /usr/lib starting with libgdal.so* and then create a soft link to those with the same name in /usr/local/lib. Restart QGIS and it will work.

0

Couldn't you build it from source? If so, referring to a working PKGBUILD on arch, you have to build gdal with the correct LDFLAG (in configure): --with-ecw=/usr.

Extract:

build() {
cd "${srcdir}"/$pkgname-$pkgver
export CFLAGS="$CFLAGS -fno-strict-aliasing"

# bug #23654
export LDFLAGS="$LDFLAGS -Wl,--as-needed" 

./configure --prefix=/usr --with-netcdf --with-libtiff --with-sqlite3 --with-geotiff \
          --with-mysql --with-python=/usr/bin/python2 --with-curl --with-hdf5 --with-perl --with-geos \
          --with-png --with-poppler --with-spatialite --with-openjpeg --with-libkml \
          --with-ecw=/usr

# workaround for bug #13646
sed -i 's/PY_HAVE_SETUPTOOLS=1/PY_HAVE_SETUPTOOLS=/g' ./GDALmake.opt
sed -i 's/EXE_DEP_LIBS/KILL_EXE_DEP_LIBS/' apps/GNUmakefile

make -j3

And also make sure that libecwj2 is properly installed.
Cheers,

0

You can try it: http://wiki.openstreetmap.org/wiki/ECW

It's working fine for me on debian (not ubuntu).

Bye.

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.