1

I'm trying to convert a portion of a fairly large ECW file to a GeoTIFF using either gdal_translate or gdalwarp. The problem I'm having is that the GeoTIFF is generated but gdal_translate and gdalwarp never close after the GeoTIFF is created. This is a problem for me because I'm calling the gdalwarp.exe from an external application and checking to see if gdalwarp finishes before displaying the GeoTIFF.

Here is what works for me: if I try to use gdalwarp or gdal_translate to convert the original ECW to a low-resolution GeoTIFF showing an overview of the entire ECW file, the program finishes without any problem. I have the problem described above when I try to use gdalwarp/gdal_translate to convert the original ECW to a low-resolution GeoTIFF showing a "zoomed" portion of the ECW file. So for example, I try the following commands:

gdalinfo temp.ecw

Driver: ECW/ERDAS Compressed Wavelets (SDK 3.x)
Files: F:\temp.ecw
       F:\temp.ecw.aux.xml
Size is 50262, 47306
Coordinate System is:
PROJCS["Israel 1993 / Israeli TM Grid",
    GEOGCS["Israel 1993",
        DATUM["Israel_1993",
            SPHEROID["GRS 1980",6378137,298.257222101,
                AUTHORITY["EPSG","7019"]],
            TOWGS84[-48,55,52,0,0,0,0],
            AUTHORITY["EPSG","6141"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4141"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",31.73439361111111],
    PARAMETER["central_meridian",35.20451694444445],
    PARAMETER["scale_factor",1.0000067],
    PARAMETER["false_easting",219529.584],
    PARAMETER["false_northing",626907.39],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AUTHORITY["EPSG","2039"]]
Origin = (151743.915535443000000,598870.729648456440000)
Pixel Size = (0.100000000000000,-0.100000000000000)
Metadata:
  COLORSPACE=RGB
  COMPRESSION_RATE_TARGET=20
  VERSION=2
Corner Coordinates:
Upper Left  (  151743.916,  598870.730) ( 34d29'28.21"E, 31d28'46.39"N)
Lower Left  (  151743.916,  594140.130) ( 34d29'29.37"E, 31d26'12.81"N)
Upper Right (  156770.116,  598870.730) ( 34d32'38.62"E, 31d28'47.41"N)
Lower Right (  156770.116,  594140.130) ( 34d32'39.69"E, 31d26'13.83"N)
Center      (  154257.016,  596505.430) ( 34d31' 3.97"E, 31d27'30.12"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
  Description = Red
  Overviews: 25131x23653, 12565x11826, 6282x5913, 3141x2956, 1570x1478, 785x739,
 392x369, 196x184
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
  Description = Green
  Overviews: 25131x23653, 12565x11826, 6282x5913, 3141x2956, 1570x1478, 785x739,
 392x369, 196x184
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
  Description = Blue
  Overviews: 25131x23653, 12565x11826, 6282x5913, 3141x2956, 1570x1478, 785x739,
 392x369, 196x184

gdalwarp.exe -ts 927 0 -te 149689.0000000000000 593667.0000000000000 158825.0000000000000 599344.0000000000000 -dstalpha -overwrite temp.ecw out.tif
0...10...20...30...40...50...60...70...80...90...100 - done.

The above commands run quickly (takes a second or two). Everything works fine and gdalwarp closes without a problem. The output image looks good. However, when I try to do the following command (where I zoom into a portion of the ECW to get more detail for a particular area), a GeoTIFF is created after a minute or so, but gdalwarp never closes:

gdalwarp.exe -ts 927 0 -te 155094.3999999999900 597195.3000000000500 156553.6000000000100 598102.0000000000000 -dstalpha -overwrite temp.ecw out1.tif
0...10...20...30...40...50...60...70...80...90...100 - done.

I have tried a similar operation using gdal_translate with the same result. If I kill gdalwarp after the "done" message is displayed, I have a GeoTIFF that seems to be what I want. But I have to kill gdalwarp to get it, and I don't want to have to kill the gdalwarp process every time I need to do this. Has anybody seen this problem with gdalwarp/gdal_translate not finishing when writing GeoTIFF's from ECW files? Is there something I can do to work around having to kill gdalwarp/gdal_translate after the processing is completed?

  • 1
    Suggest you move to an up to date ECW SDK. 3.3 is from 2006 and is very buggy. If you're using GIS Internals gdal binaries, grab the ECW 5.5 installer. – user2856 Aug 15 '18 at 23:09
2

As described by Luke, it looks like upgrading to the latest version of the ECW SDK (5.5) solves the problem. I just used the version from the gisinternals.com web site.

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.