[Gdal-dev] Problem with gdal_translate with the parameter -a_ullr 0 0 x x

Jean-Claude Repetto jean-claude.repetto at worldonline.fr
Tue Oct 23 17:21:10 EDT 2007


Jean-Claude Repetto wrote :

> The conversion is OK for all the tiles except one. This tile has
> something special, the coordinates of the UL-LR corner are both zero :
> 
> gdal_translate -of ECW -co TARGET=88% -co DATUM=WGS84 -co PROJ=GEODETIC
> -co LARGE_OK=YES -a_ullr 0 0 45 -45 -srcwin 0 10800 5400 5400
> land_shallow_topo_east.tif 42.ecw
> 

The ECW file is correct. I have checked it by reading it directly with
the ECW library.
The bug occurs when GDAL reads the file. I have looked at the source
code (version 1.4.2), and it seems the bug is in the file ecwdataset.cpp :

/* -------------------------------------------------------------------- */
/*      Capture Geotransform.                                           */
/* -------------------------------------------------------------------- */

    if(  psFileInfo->fOriginX != 0.0
        || psFileInfo->fOriginY != 0.0
        && (psFileInfo->fCellIncrementX != 0.0 &&
            psFileInfo->fCellIncrementX != 1.0)
        && (psFileInfo->fCellIncrementY != 0.0 &&
            psFileInfo->fCellIncrementY != 1.0) )
    {
	bGeoTransformValid = TRUE;


When the coordinates of the origin are both equal to 0.0, GDAL thinks
the parameters are invalid, but why ?

Thanks for your help,
Jean-Claude




More information about the Gdal-dev mailing list