This repository contains a Dockerfile and Makefile for converting ECW files to TIFF format using GDAL in a Docker container.
The Docker image has GDAL build from source with the ECWJP2 5.5 SDK for ECW support.
This is based heavily on hexagon ECWJP2 SDK 5.5. The SDK needs to be downloaded manually from here because it requires registration and placed in next to the Dockerfile with the name ECWJP2SDKSetup_5.5.0.2268-Update4-Linux.zip
. The SDK is then copied into the Docker image and installed.
If there is no need for v3 ECW files one can use the version v0.0.1
which does not require a manual download of the SDK.
Python 3.10 is also installed in the image, as well as the GDAL Python bindings.
The Makefile contains commands to build the Docker image and run the conversion process. It makes use of the Docker image to execute the gdal_translate
command to convert raster data between different formats.
The Makefile uses the following variables:
IMAGE
: The name of the Docker image. Default isecw2tif:v0.0.1
.INPUT
: The directory, file path or glob pattern for the .ecw files to convert. Either absolute or relative to the Makefile. Defaults to./input
.OUTPUT_DIR
: The directory to output the resulting .tiff files. Defaults to./output
.
The Makefile defines the following targets:
build
: Builds the Docker image using the specifiedIMAGE
.convert
: Converts all files specified byINPUT
to .tiff and places the results inOUTPUT_DIR
.
- Clone this repository and navigate to its directory.
- Build the Docker image with
make build
. - Convert .ecw files in the with
make convert INPUT=input/exa*.ecw OUTPUT_DIR=output
.
- Only tested on Linux.
- Docker must be run with appropriate permissions to access the directories.
- The conversion process might take some time, depending on the size and number of input files.
- The docker image is not optimised for size, and is currently around 5GB.