I try unsuccessfully to install the ECW support (mainly to use ECW file in QGIS 2.2). We attempt to follow and adapt the howto provided by makina-corpus. My first supprise was the repository ubuntugis-unstable is unavailable for trusty and the repository http://qgis.org/debian doesn't have libgdal-ecw-src package. Finally in desperation we add ubuntugis-unstable for the raring distribution in source.list.

And apply the following commands

chmod +x ERDAS-ECW_JPEG_2000_SDK-5.1.1.bin
./ERDAS-ECW_JPEG_2000_SDK-5.1.1.bin # Select option desktop read only
sudo cp -r ERDAS-ECW_JPEG_2000_SDK-5.1.1 /usr/local/
sudo ln -s /usr/local/ERDAS-ECW_JPEG_2000_SDK-5.1.1/Desktop_Read-Only/lib/x86/release/libNCSEcw.so /usr/local/lib/libNCSEcw.so
sudo ldconfig
sudo apt-get install libgdal-ecw-src
sudo gdal-ecw-build /usr/local/ERDAS-ECW_JPEG_2000_SDK-5.1.1/Desktop_Read-Only

The ECW format seems to be installed

gdalinfo --formats | grep -i ecw
  ECW (rw+): ERDAS Compressed Wavelets (SDK 5.1)
  JP2ECW (rw+v): ERDAS JPEG2000 (SDK 5.1)

But .... Gis crash when a ECW raster file is open with the following message :

QGIS died on signal 4Abandon (core dumped)

If anyone have an idea

up vote 9 down vote accepted

By now, ubuntugis-unstable has added trusty packages for QGIS 2.2 and GDAL 1.11. Unfortunately, libgdal-ecw-src is still missing, and the available versions for raring and precise are intended for GDAL 1.10.

However, I got it working (with some help from the qgis user mailing list):

  1. Add ubuntugis-unstable for trusty to the sources list, or Ubuntu Software center
  2. Install QGIS 2.2, GDAL 1.11 and libgdal-dev
  3. Make sure QGIS is working
  4. Download the ERDAS ECW SDK 5.1 for Linux from http://download.intergraph.com/
  5. Open a terminal window and enter
chmod +x ECWJP2SDKSetup_5.1.1.bin
./ECWJP2SDKSetup_5.1.1.bin #Select desktop-read-only and accept the license)
sudo cp -r ERDAS-ECW_JPEG_2000_SDK-5.1.1 /usr/local/
sudo ln -s /usr/local/ERDAS-ECW_JPEG_2000_SDK-5.1.1/Desktop_Read-Only/lib/x64/release/libNCSEcw.so /usr/local/lib/libNCSEcw.so
sudo ldconfig

To avoid version conflicts, we do not install libgdal-ecw-src with apt-get, but fetch it manually and extract it:

wget https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable/+files/libgdal-ecw-src_1.10.0-1~precise4_all.deb
ar vx libgdal-ecw-src_1.10.0-1~precise4_all.deb
tar -xzf data.tar.gz
sudo cp usr/src/libgdal-ecw-1.10.0.tar.gz /usr/src/
sudo cp    usr/bin/gdal-ecw-build /usr/bin/
sudo gdal-ecw-build /usr/local/ERDAS-ECW_JPEG_2000_SDK-5.1.1/Desktop_Read-Only 

GDAL from ubuntugis is 1.11, but the script stores the plugin into /usr/lib/gdalplugins/1.10, hence it is not found by gdalinfo.

So I created a subfolder 1.11 and copied the .so file into it:

 sudo mkdir /usr/lib/gdalplugins/1.11
 cd /usr/lib/gdalplugins/1.10
 cp gdal_ECW_JP2ECW.so /usr/lib/gdalplugins/1.11 

Now you can run:

 gdalinfo --formats | grep -i ECW 
 ECW (rw+): ERDAS Compressed Wavelets (SDK 5.1)   
 JP2ECW (rw+v): ERDAS JPEG2000 (SDK 5.1)

The SDK folder has a testdata subfolder with some samples, which should work with QGIS (also on Windows and Ubuntu 12.04).


UPDATE 09-2015

It seems that my workaround does not work with newer versions of ubuntu. There is no gdal package yet available at ubuntugis for vivid (15.04). Utopic (14.10) might be the latest to work, but I have not tested it.

  • Thank you for the answer it's working perfectly. Just for information first I try with raring's libgdal-ecw package (that I suppose to be up to date) but it's seems to be not found by gdalinfo. – user29858 Jun 30 '14 at 17:02
  • There's a stray space in the symbolic link step before "/libNCSEcw.so". I can't remove it because apparently fixing just one character is not allowed. – mdsumner Oct 26 '14 at 9:45
  • Thanks a lot for this helpful answer (I upvoted). One note: I am using Linux Mint 17.1 (Rebecca) based on Trusty, and I had to copy the gdal_ECW_JP2ECW.so to /usr/local/lib/gdalplugins/1.11/ (in stead of /usr/lib/gdalplugins/1.11/). Works great now with gdal 1.11 and QGIS 2.18 (Wien) – Niels Jun 3 '15 at 8:25
  • I confirm the 5.2.1 SDK does not work with the libgdal-ecw sources above. The only working version I have been able to run is built using libecwj2 (v3.3 from aur.archlinux.org/packages/libecwj2), libgdal-ecw (v1.10.0-4 from repo.yume.ru/unstable/libgdal-ecw_1.10.0-4_amd64.deb), gdal-bin package (v1.11.3). – Rot Ulet Nov 5 '15 at 9:03
  • Thanks, AndreJ: Helped me with QGIS 2.12 running on Mint 17.2 – Micha Nov 9 '15 at 9:23

I think that ubuntugis repository does not match exactly the OS version. Perhaps you could try to install Qgis from a stand-alone version, but I'd rather do the downgrade of the OS version and install the right ubuntugis repository version

  • Your right, I just wanted to try the new ubuntu LTS, Unfortunately I will downgrade my OS. But I wonder why ubuntugis is not available for trusty. – user29858 May 4 '14 at 18:40
  • That it is because the development of the various packages is in progress. – MickyInTheSky May 5 '14 at 7:02

Apparently It's working with raring package according to this message https://www.mail-archive.com/ubuntu@lists.osgeo.org/msg00829.html#.

I think my problem is related to 32bit. After downgrading to xubuntu 12.04, I was unable to compile the SDK 5.0 (libtool wasn't reconize). With SDK 5.1 it's seems to work : the command gdalinfo --formats | grep -i ecw return

ECW (rw+): ERDAS Compressed Wavelets (SDK 5.1)
JP2ECW (rw+v): ERDAS JPEG2000 (SDK 5.1)

But Qgis still crash when I try to open ECW file with the following message :

The crashed program seems to use third-party or local libraries:
 /usr/local/ecwjp2_sdk/lib/x86/release/libNCSEcw.so.5.1.1
  • Does it help to use the x64 version instead of x86? – AndreJ Jun 17 '14 at 8:14

In Linux Mint 17, you could encounter this error:

ERROR 1: libNCSEcw.so: cannot open shared object file:...

In this case, manually add this line /usr/local/lib/release in /etc/ld.so.conf by running

sudo gedit /etc/ld.so.conf

Add a ubuntugis ppa in /etc/apt/sources.list -> sudo gedit /etc/apt/sources.list

deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu raring main deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu raring main

Update source list -> sudo apt-get update

Install -> sudo apt-get install libgdal-ecw-src

See on this post http://muhammadbaihaqi-martin92.blogspot.com/2014/05/install-ecw-support-qgis-220-valmiera.html

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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