[gdal-dev] gdalwarp on a file + world file - different limits

Joaquim Luis jluis at ualg.pt
Mon Jan 26 16:42:34 EST 2009


Frank,

I'm afraid there was nothing so thought in the use of gdalwarp.
Yes, the idea is to assign a coordinate system. Since the world file is meant
for referencing linear referencing, it could not correctly describe (for instance)
a Mercator projected image. So I thought in using gdalwarp.
The fact that the pixels in the TFW are not exactly square is beyond our control.
Recall that we start with a postscript image and want to end up with an
as-good-as-possible geotiff image.

Thanks

Joaquim


> Joaquim Luis wrote:
>> (which executes this command)
>> gdalwarp -s_srs "+proj=stere +lat_0=-60 +lon_0=-55 +k=1 +x_0=0 +y_0=0 
>> +a=6378137.000 +b=6356752.314245" out.tif out.tiff
> 
> Joaquim,
> 
> I'm curious why you use the above command.  What is it intended to do?
> If it is just to assign the coordinate system you could use gdal_translate
> with -a_srs.  Perhaps the goal is also to rotate non-north up files to be
> north up?
> 
>> But when I compare the gdalinfo output of the two files they do not 
>> agree.
>> Why are the LR coords from the geotiff file different from the tif + 
>> .tfw?
>> And where do they come from?
>  ...
>> # ----------  THE .TFW CONTENTS
>> 677.678633953751    # x_inc
>> 0.0
>> 0.0
>> -677.201365837256    # y_inc
>> -1389588.373683023000    # X-UL
>> 1335922.909317081300    # Y-UL
> 
> I see the file represented by the TFW does not exactly have
> square pixels.  I presume gdalwarp has developed a square pixel
> size, and the resulting file had to have it's extents extended a
> bit to account for the altered pixel size.
> 
> Perhaps the gdalwarp was actually done to "square" the pixels? Or
> perhaps the tfw was improperly computed and the pixels were never
> really intended to be non-square?
> 
> Best regards,



More information about the gdal-dev mailing list