2

I downloaded ERDAS-ECW_JPEG_2000_SDK-5.1.1 and tried to use it with GDAL to create ECW files from georeferenced PNG files, but they are not created, it basically complains about:

ERROR 1: None of ECW_ENCODE_KEY and ECW_ENCODE_COMPANY were provided.

I thought it was free to do so with files smaller than 500 MB (mine is 50 MB). Here the full output:

+ gdalwarp -of ECW -t_srs EPSG:4326 -srcnodata 128 -dstalpha s05w85_200_200_F1_R3_z.png s05w85_200_200_F1_R3_z.ecw
Creating output file that is 14185P x 14185L.
Processing input file s05w85_200_200_F1_R3_z.png.
Using band 4 of source image as alpha.
Copying nodata values from source s05w85_200_200_F1_R3_z.png to destination s05w85_200_200_F1_R3_z.ecw.
ERROR 6: s05w85_200_200_F1_R3_z.ecw, band 1: SetNoDataValue() not supported for this dataset.
ERROR 6: s05w85_200_200_F1_R3_z.ecw, band 2: SetNoDataValue() not supported for this dataset.
ERROR 6: s05w85_200_200_F1_R3_z.ecw, band 3: SetNoDataValue() not supported for this dataset.
0ERROR 1: None of ECW_ENCODE_KEY and ECW_ENCODE_COMPANY were provided.
Both are required.
ERROR 1: None of ECW_ENCODE_KEY and ECW_ENCODE_COMPANY were provided.
Both are required.
ERROR 1: None of ECW_ENCODE_KEY and ECW_ENCODE_COMPANY were provided.
Both are required.
ERROR 1: None of ECW_ENCODE_KEY and ECW_ENCODE_COMPANY were provided.
Both are required.
.ERROR 1: s05w85_200_200_F1_R3_z.ecw, band 5: An error occured while writing a dirty block
ERROR 1: s05w85_200_200_F1_R3_z.ecw, band 1: An error occured while writing a dirty block
ERROR 1: s05w85_200_200_F1_R3_z.ecw, band 2: An error occured while writing a dirty block
ERROR 1: s05w85_200_200_F1_R3_z.ecw, band 3: An error occured while writing a dirty block

The only solution to get those keys is to buy that ERDAS software? again, I had the impression that it could be possible.

Any support is very welcomed,

EDIT 1:

I want to say that I tried ERDAS SDK 3.3 with GDAL installed from both apt-get and source ways, and none of them have worked so far, it throws an error after running this:

gdal_translate -of ECW s05w85.png test.ecw

Input file size is 14185, 14185
terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_S_create
Aborted

Moreover, this occurs when I use gdal_translate, but using gdalwarp keeps saying Output driver ECW not recognised or does not support, even though this command line says:

gdalwarp --formats | grep -i ecw
ECW -raster- (rw): ERDAS Compressed Wavelets (SDK 3.x)
JP2ECW -raster,vector- (rw+v): ERDAS JPEG2000 (SDK 3.x)

So, I'm confused, is it really possible to create ECW files for free with ERDAS SDK 3.3??

  • 2
    considered geotiff with jpeg compression? – Nathan W May 24 '15 at 9:43
  • 1
    I think the base question is 'How do you license ECW compression in GDAL with the new SDK'.. there are new features in ECW for this SDK which makes them quite attractive as a GIS format. Does one just contact Hexagon directly? Is it different by country (like Esri)? Do you need to purchase ERDAS to get the capability? +1 Very good question! – Michael Stimson May 24 '15 at 23:32
  • @NathanW thanks for tip, I've found that this would be a good option, but also JP20OpenJPEG, but I want to know if ECW can really be built with ERDAS SDK 3.3 and GDAL, I've read that gdalwarp can't be used with that format to create files, but it can be possible with gdal_translate. – Gery May 25 '15 at 2:52
  • @MichaelMiles-Stimson thanks for your questions, hope someone can build a nice answer including the solution I want and the points you mentioned, so I can mark it as the final answer. – Gery May 25 '15 at 2:54
2

From http://www.gdal.org/frmt_ecw.html

For those still using the ECW 3.3 SDK, images less than 500MB may be compressed for free, while larger images require licensing from ERDAS. See the licensing agreement and the LARGE_OK option.

So you are out of luck with the 5.1 SDK without a valid license.

Depending on your OS, you might still catch a copy of the old SDK somewhere.

EDIT

http://www.gisinternals.com/archive.php has Windows builds which were compiled with the ecw 3.3 SDK up to GDAL version 1.10.0 (and some MSVC2005 builds of newer versions too).

  • Exactly. Windows users can acquire ECW SDK 3.3 based plugin from gisinternals.com/sdk. It is more difficult if you want to build the plugin yourself because Hexagon Geospatial does not deliver 3.3. SDK any more. – user30184 May 24 '15 at 9:30
  • @AndreJ thanks for the answer, that was missing then, anyone willing to share ECW 3.3. SDK for ubuntu? – Gery May 24 '15 at 13:44
  • 1
    Try this blog entry: blog.technokrat.nl/2012/11/28/…. The download link seems to work. You might need an older version of GDAL too: gis.stackexchange.com/questions/94870/… – AndreJ May 24 '15 at 17:55
  • 1
    @Gery, ECW does not support CREATE, only CREATECOPY. Workaround is to gdalwarp to VRT first, then gdal_translate to ECW. – user2856 May 25 '15 at 3:06
  • 2
    @Gery Did you apply the patches referenced in the wiki? In particular the one discussed in this ticket. – user2856 May 31 '15 at 8:39
0

First of all, I want to thank all the support I received from you guys, to AndreJ Luke, Nathan W, Michael Miles-Stimson and user30184. Following all your suggestions finally I could successfully install ECW SDK 3.3, I follow basically what appears in the OpenStreetMap Wiki. I describe below all the steps I used, a small modification from the steps explained in the Wiki:

  1. I installed all GIS-related software from the stable/unstable UbuntusGIS repo (qgis, proj, geos, etc). However, I downloaded the latest stable GDAL version from http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz and installed it in /opt (see point 3).
  2. I downloaded the libecwj2-3.3 and installed as follows (using only the wcharfix patch):
wget http://mirror.ovh.net/gentoo-distfiles/distfiles/libecwj2-3.3-2006-09-06.zip
unzip libecwj2-3.3-2006-09-06.zip
wget http://osgeo-org.1560.x6.nabble.com/attachment/5001530/0/libecwj2-3.3-wcharfix.patch
wget http://trac.osgeo.org/gdal/raw-attachment/ticket/3366/libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch
wget http://trac.osgeo.org/gdal/raw-attachment/ticket/3162/libecwj2-3.3-msvc90-fixes.patch
patch -p0 < libecwj2-3.3-wcharfix.patch
  locate NCSPrefsXML.cpp | grep libecwj2-3.3
  (when you found it, just re-run the previous patch command line and paste the full path+CPPname found with locate)
patch -p0 < libecwj2-3.3-msvc90-fixes.patch
patch -p0 < libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch
  locate malloc.c | grep libecwj2-3.3
  (when you found it, just re-run the previous patch command line and paste the full path+Cname found with locate)
cd libecwj2-3.3/
./configure
make 
make install
  1. I installed GDAL-1.11.2 as follows:
tar xzvf gdal-1.11.2.tar.gz
sudo mv /home/gery/Desktop/gdal-1.11.2.tar.gz .
sudo chmod a+wx gdal-1.11.2.tar.gz 
sudo tar xzxf gdal-1.11.2.tar.gz 
cd gdal-1.11.2/
sudo ./configure --with-ecw=/usr/local --with-python --with-proj --with-geos
sudo make
sudo make install

Hope this helps!

PS.

$ uname -a

Linux 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.