Most simple ECW support for gdal on Debian 11 (bullseye)
Hugely based on https://github.com/interob/libgdal-ecw
Rationale
GIS people usually do not care about the formats they are using but they tend to care about storage space. For this reason customers often supply their data in compressed form.
Unfortunately this often means that they use the patented and proprietary ECW-format.
To the recue
Hexagon Geospatial provides a proprietary library for reading ECW files: http://download.hexagongeospatial.com/downloads/ecw/erdas-ecw-jp2-sdk-v5-5-update-4-linux
This said all you usually need in the world of FOSS GIS Software is support in GDAL thus this code will build a single self-sufficient Plugin for GDAL using the proprietary ECW library which can be copied to /usr/lib/gdalplugins/ on Debian/Ubuntu based distributions.
Installation
- Install
libgdal-dev
package. - Clone this repository:
git clone https://github.com/giggls/gdal-ecw-plugin
- Download and extract
ECWJP2SDKSetup_5.5.0.2268-Update4-Linux.zip
. This will give youECWJP2SDKSetup_5.5.0.2268.bin
- Put this file into the cloned directory and run
- Call
make
which will give you a file calledgdal_ECW_JP2ECW.so
- Copy
gdal_ECW_JP2ECW.so
into /usr/lib/x86_64-linux-gnu/gdalplugins or callsudo make install
. - Optionally call
make mrproper
which will remove thehexagon
folder from your home directory.
To check if this worked properly call gdalinfo --formats
command which should
give you something like this:
~/ > gdalinfo --formats |grep -i ECW
ECW -raster- (rw+): ERDAS Compressed Wavelets (SDK 5.5)
JP2ECW -raster,vector- (rw+v): ERDAS JPEG2000 (SDK 5.5)