[Gdal-dev] default pixel size in gdalwarp

Frank Warmerdam warmerdam at pobox.com
Wed Jul 29 01:29:53 EDT 2009


agnes123 wrote:
> 
> Dear all,
> 
> i have one question on the default pixel size in gdalwarp. 
> 
> In gdalwarp, we can use -tr to determine output pixel size in x and y
> direction, however, if i omit the argument -tr , gdal will have a default
> pixel size value which is in target projection units. 
> 
> For example, if the orginal input raster which has geodetic projection with
> pixel size 0.000277778 (decimal degree), after projecting to Lambert
> Conformal Conic without typing the argument -tr, gdal will have output
> raster pixel size 28.793808m. What is the algorithm behind to obtain the
> value 28.793808? 
> 
> I was wondering if there is somebody who knows it. I would greatly
> appreciate it.Thanks!
> 
> Regards,
> Agnes
> 

Agnes,

The computation is done by the GDALSuggestedWarpOutput2() function.  I would
suggest you read it's documentation and if still in doubt scan through the
code.

   http://trac.osgeo.org/gdal/browser/trunk/gdal/alg/gdaltransformer.cpp#L162

It is basically a heuristic to maintain approximately the same diagonal
size of a pixel in the destination coordinate system as it was in the
source coordinate system.

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