[Gdal-dev] gdal with ECW JPEG 2000 SDK v3.1

Tom Lynch tflynch at gmail.com
Thu Mar 17 02:13:08 EST 2005

I previously responded to Brent off list on this topic, but for the
benefit of anyone else wishing to enable unlimited compression to ECW
and JPEG 2000 via GDAL and the ECW JPEG 2000 SDK, these are the
specific changes that are necessary in the GDAL source code (both are
calls to CNCSFile::SetKeySize):

1. Changes to ecwcreatecopy.cpp:

CPLErr GDALECWCompressor::Initialize(
    const char *pszFilename, char **papszOptions,
    int nXSize, int nYSize, int nBands,
    GDALDataType eType,
    const char *pszWKT, double *padfGeoTransform,
    int bIsJPEG2000 )


2. Changes to ecwdataset.cpp:


GDALDataset *ECWDataset::Open( GDALOpenInfo * poOpenInfo )


/* -------------------------------------------------------------------- */
/*      Open the client interface.                                      */
/* -------------------------------------------------------------------- */
    if( poFileView == NULL )
        poFileView = new CNCSFile();

These two lines are needed in addition to linking with NCSEcwCu.lib
(or libNCSEcwCu.o if you're building the SDK from source on *NIX) for
unlimited compression.

Tom Lynch
Development, ER Mapper
Phone:      +61 8 93882900
Fax:        +61 8 93882901
Email:      tom.lynch at ermapper.com
Web:        http://www.ermapper.com
Forums:     http://forum.ermapper.com

On Mon, 14 Mar 2005 12:49:49 -0700, Brent Fraser
<bfraser at geoanalytic.com> wrote:
> Frank,
>    I've been trying to get gdal_translate to compress a 700gb tiff image to
> ECW (on win2k).  This is greater than the 500gb limit imposed by the ECW SDK
> prior to v3.0.  According to the ECW SDK v3.1 doc:
> "If you wish to enable unlimited compression to the ECW or JPEG 2000 formats
> (as permitted by the Public and Commercial Use License Agreements), you must
> link your application with NCSEcwCu.lib instead of NCSEcwC.lib. "
> So I linked gdal_translate with NCSEcwCu.lib and ran it to get the
> following:
> C:\gdal\gdal-1.2.6\apps>gdal_translate -of ECW  321fuse.tif 321fuse.ecw
> Input file size is 17100, 15340
> 0.100 - done.
> ERROR 4: `321fuse.ecw' does not exist in the file system,
> and is not recognised as a supported dataset name.
> But it works fine on images less than 500mb.  I compiled the
> NCSSource_3.1rc1_18Feb05 version, but got the same result.
> Have you tested gdal with the unlimited-compression ECW library?  Any other
> things I need to do?
> Thanks!
> Brent Fraser
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at xserve.flids.com
> http://xserve.flids.com/mailman/listinfo/gdal-dev

More information about the Gdal-dev mailing list