[Gdal-dev] reproject a big ecw

Frank Warmerdam warmerdam at pobox.com
Thu Oct 18 09:51:01 EDT 2007


SAEZ Laurent - CETE Méditerr./DI/ETER wrote:
> Hi,
> 
> I've a big problem with gdalwarp.
> I've to reproject a big ecw from the NTF - Lambert II étendu to the RGF93 - Lambert 93.
> The ecw source file is about 7 Go. The final file will be also in ecw format.
> I use FWTools 1.3.9 on Windows XP SP2 with 2 Go of RAM.
> I have to make an intermediate file in ENVI hdr format because it seems that gdalwarp can't creat ecw files.
> I use the syntax below to do the job :
> 
> gdalwarp --DEBUG ON --config GDAL_CACHEMAX 400 -wm 400 -rn -tr 0.5 0.5 -of EHdr -co "INTERLEAVE=BIL" -s_srs "+proj=lcc +a=6378249.2 +b=6356515.0 +lat_0=46d48'0.0N +lon_0=2d20'14.025E +lat_1=45d53'56.108N +lat_2=47d41'45.652N +x_0=600000.0 +y_0=2200000.0 +nadgrids=NTF2RGF93.gsb +units=m +wktext"  -t_srs EPSG:2154 "G:\34-2005-LA2E-C10.ecw" "I:\34-2005-L93-C10.bil"
> 
> The job is stopped with the following message :
> ECWDataset: RasterIO(42565,10965,8846,5773 -> 8846x5773) - doing interleaved rea
> d.
> GDAL: GDALWarpKernel()::GWKNearestNoMasksByte()
> Src=42565,10965,8846x5773 Dst=43937,11385,8788x5692
> ERROR 2: Failed to allocate 153230412 byte source buffer.
> GDAL: GDALClose(G:\34-2005-LA2E-C10.ecw)
> GDAL: GDALClose(I:\34-2005-L93-C10.bil)
> GDAL: GDALDeregister_GTiff() called.

Larent,

The error is an "out of memory" error.  One possibility is that you
configured things (via GDAL_CACHEMAX and -wm) to use more
memory than you have practically available.  The other is that there
is a memory leak somewhere that is causing problems.

Did you get this error immediately or was there a bunch of progress (as
reported by the percent complete progress monitor) first?

The recent fix to a memory leak described in:

   http://trac.osgeo.org/gdal/ticket/1922

might be related, though I'm a bit doubtful.

PS. using a tiled format such as HFA (Erdas Imagine) may be better than
a scanline oriented format like EHdr for your working file.  It maps better
to the "chunks" that the warper operates on.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list