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

Frank Warmerdam warmerdam at pobox.com
Mon Jan 26 14:59:52 EST 2009


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,
-- 
---------------------------------------+--------------------------------------
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    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list