How do I add and view *.ecw raster images in Qgis 2.0 ?
[GIS] How to add *.ecw files to QGIS 2.0 on Windows
ecwgdalqgis-2windows
Related Solutions
Sorry for late reply, had to get time free to sort it out from a brand new setup. Found out what is causing it and it has nothing to do with using the correct gdal as suggested in Answer 1 (I did run into it before as automatic updates on linux will happily upgrade the qgis-installed GDAL to 1.9.1-2~precise4 and you get that version-mismatch error).
A fresh install of QGIS 1.8.0 on a new linux mint 13 (ubuntu 12.04 precise) installs GDAL 1.7.3-6ububtu3 and that is the one against which the ECW support gets compiled. I did exactly the same as listed in my original post, and as expected the qgis-installed gdal 1.7 does support ECW while QGIS does not. Back to square one...
However, in the course of digging through tons of website pages, I did come across a post somewhere (lost which one, though) that mentions that from gdal 1.8 the location of the pluginsdirectory has changed from gdalXXplugins to gdalplugins/1.8. As QGIS 1.8.0 actually uses GDAL 1.7.3-6ubuntu3 under the hood I had ignored that info. Unfortunately, this information is not correct!! GDAL 1.7.3 also needs to have the plugin stored in the gdalplugins/1.7 folder! This is not done by the scripts so you have to do it manually. I did it by using prefixes on my last install, but it is as easy to just create the /usr/lib/gdalplugins/1.7 folder by hand and copy/move the so file from the /usr/lib/gdal17plugins folder. Done. Now QGIS 1.8.0 finds the plugin and loads ECW fine.
Hope this helps others in the same situation. Not to mention the fact that one must find the correct gdal ecw source! The 1.7.2 source is only found when you edit the repo by hand to use the old "hardy" version. If only qgis.org could keep that one file in its repo too... Sigh. Lewie
The workaround is to use another GDAL that has ECW compiled and convert to a format that raster2pgsql supports. I suggest looking at the http://www.gisinternals.com/sdk/ Those are built whenever a change in GDAL and have ECW support I believe.
Unfortunately the gdal that raster2pgsql is packaged with is incompatible with the VC+ build ones and the gdal just has the basic formats that don't require us adding extra depency files. So you can't just replace the gdal dll.
We are the package maintainers for windows PostGIS. Others have voiced similar issue. We are planning to in future have a version of gdal built with VC that is swappable for those who need it.
We don't plan to compile proprietary support in the stackbuilder distributed GDAL for obvious reasons and also it makes the packaging not as light weight.
Best Answer
This is an edited form of the solution that the OP had put in the Question
Note: The QGIS 64bit installer used GDAL 1.10 which has the ECW plugin included. The 32bit installer is getting updated to GDAL 1.10 with the plugin at some stage, no ETA at the moment. The following method is only needed for the 32bit installer until it updated with the new GDAL.
I had to solve this for work so thought i should share given the QGIS 2.0 release. It is basically a rehash of a post by Giovanni Manghi in Feb 2013 but with correct paths for .dll files.
install this package http://www.gisinternals.com/sdk/Download.aspx?file=release-1600-gdal-1-9-2-mapserver-6-2-0\gdal-19-1600-ecw.msi
once installed goto: \Program Files\GDAL\libecwj2.dll \Program Files\GDAL\gdalplugins\gdal_ECW_JP2ECW.dll
copy libecwj2.dll into \OQGIS Dufour\bin folder
copy gdal_ECW_JP2ECW.dll into QGIS Dufour\bin\gdalplugins\1.9 Folder
Then restart your computer and load QGIS 2.0
Select Layer>Add Raster Layer
Select a *.ecw file> open
Done.