Search code examples
gdal

Installing GDAL with ECW support


Most (all?) information online is outdated since ECW (Hexagon Geospatial/Intergraph) has recently released new versions with breaking changes (5.0, 5.1 and 5.2).

Most instructions result in errors like:

checking for libNCSEcw.so or libecwj2... configure: error: not found in /usr/local/lib or /usr/local/bin


Solution

  • This works for GDAL 1.11.2, but it should work back to 1.10.0.

    Download the latest version of the ECW library from here (currently 5.5): https://download.hexagongeospatial.com

    Instructions for v5.2.1, but should be similar for the latest version:

    $ unzip erdas-ecwjp2sdk-v5.2.1-linux.zip
    $ chmod +x ERDAS_ECWJP2_SDK-5.2.1.bin
    $ ./ERDAS_ECWJP2_SDK-5.2.1.bin
    

    Choose Desktop Read-Only and accept the license. A directory named hexagon is extracted. Copy that to /usr/local.

    $ sudo cp -r hexagon/ERDAS-ECW_JPEG_2000_SDK-5.2.1/Desktop_Read-Only /usr/local/hexagon
    

    Link the .so library for the correct architecture:

    $ sudo ln -s /usr/local/hexagon/lib/(x64|x86)/release/libNCSEcw.so /usr/local/lib/libNCSEcw.so
    

    Then configure GDAL with this command:

    $ ./configure --with-ecw=/usr/local/hexagon